How to style placeholder attribute across all browsers?
This question already has an answer here:
Placeholder text in inputs has (in the browsers implementing it so far) a light gray color. To style it, you'll need vendor prefix CSS properties.
::-webkit-input-placeholder {
color: red;
}
:-moz-placeholder { /* Firefox 18- */
color: red;
}
::-moz-placeholder { /* Firefox 19+ */
color: red;
}
:-ms-input-placeholder {
color: red;
}
You may also check this very similar question:
上一篇: 用于占位符html的CSS颜色
下一篇: 如何在所有浏览器中设置占位符属性的样式?