input[type=number] placeholder color in FF29+

隐身守侯 提交于 2019-11-27 03:24:14

问题


<input type="text" placeholder="test" />
<input type="number" placeholder="test" />

How do I style it?

:-moz-placeholder {
  color: red;
  opacity: 1;
}

::-moz-placeholder {
  color: red;
  opacity: 1;
}

Why doesn't the global placeholder work on it, even though firebug shows it's applied? Is it a bug, is it an intention?

http://jsbin.com/papad/1/edit?html,css,output


回答1:


It's apparently a bug:

  • Firefox 29.0 the ::-moz-placeholder css pseudo-element selector is not honored for with type="number"

However, it seems to actually work for some users...



来源:https://stackoverflow.com/questions/23512846/inputtype-number-placeholder-color-in-ff29

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!