css - Firefox 上的占位符文本颜色
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19621306/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
css - placeholder text color on firefox
提问by t q
I have a placeholder
text inside an input
form field that i can'tseem to change color to white
, it comes out as grey
but only on firefox. Chrome browser seems to be fine.
我有一个placeholder
内部的文本input
窗体字段,我不能似乎改变颜色white
,它出来的grey
,但只有在Firefox。Chrome浏览器似乎没问题。
When you type into the field the correct color displays, its just the initial placeholder
that is not responsive.
当您在字段中输入正确的颜色时,它只是placeholder
没有响应的初始颜色。
Any help will be appreciated please, thank you.
任何帮助将不胜感激,谢谢。
css:
css:
input#myinput::-webkit-input-placeholder {
color:#FFF; background-color:#CCC;
}
input#myinput::-moz-placeholder {
color:#FFF; background-color:#CCC;
}
input#myinput:-moz-placeholder {
color:#FFF; background-color:#CCC;
}
input#myinput::-ms-input-placeholder {
color:#FFF; background-color:#CCC;
} /* IE10+ */
input[type="text"]{
width:170px; height:16px; padding:12px 5px; border:none;
color:#FFF; font:14px/14px 'Arial', Helvetica, sans-serif;
text-align:center; background-color:#CCC;
}
回答by Fabrício Matté
回答by DevWL
//PLACEHOLDER EXAMPLE
::-webkit-input-placeholder { /* WebKit, Blink, Edge */
color: #666;
}
:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
color: #666;
opacity: 1;
}
::-moz-placeholder { /* Mozilla Firefox 19+ */
color: #666;
opacity: 1;
}
:-ms-input-placeholder { /* Internet Explorer 10-11 */
color: #666;
}
回答by Ilja
Try
尝试
::-webkit-input-placeholder {
color: #fff;
}
:-moz-placeholder { /* Firefox 18- */
color: #fff;
}
::-moz-placeholder { /* Firefox 19+ */
color: #fff;
}
:-ms-input-placeholder {
color: #fff;
}