Css 如何更改占位符的颜色?

Css 如何更改占位符的颜色?,css,Css,如何更改选定输入字段占位符的颜色 input[type="text"].smInput{ color: #333; } 占位符文本作为伪元素公开给CSS,因此请使用伪元素选择器。它尚未标准化,因此您需要为支持它的布局引擎重复选择器: input[type=text].smInput::-moz-placeholder, input[type=text].smInput:-ms-input-placeholder, /* IE uses a pseudo-class rather than ps

如何更改选定输入字段占位符的颜色

input[type="text"].smInput{
color: #333;
}

占位符文本作为伪元素公开给CSS,因此请使用伪元素选择器。它尚未标准化,因此您需要为支持它的布局引擎重复选择器:

input[type=text].smInput::-moz-placeholder,
input[type=text].smInput:-ms-input-placeholder, /* IE uses a pseudo-class rather than pseudo-element */
input[type=text].smInput::-webkit-input-placeholder, {
    color: #333;
}
资料来源:


可能重复:请像这样使用谷歌,然后再提问
站点:stackoverflow.com我们如何更改占位符的颜色
input[type=text].smInput::-moz-placeholder,
input[type=text].smInput:-ms-input-placeholder, /* IE uses a pseudo-class rather than pseudo-element */
input[type=text].smInput::-webkit-input-placeholder, {
    color: #333;
}
input:-moz-placeholder, textarea:-moz-placeholder{
    color: #222;
}
input::-webkit-input-placeholder, textarea::-moz-placeholder{
    color: #222;
}