<input type = "text" placeholder = "type here some text" />
input::-webkit-input-placeholder {}
input:-moz-placeholder {}
input:-moz-placeholder,
input::-webkit-input-placeholder { }
then CSS rules will not work. And note that you need to write two colons for webkit, and one for mozilla./* webkit */
#field2::-webkit-input-placeholder { color:#00f; }
#field3::-webkit-input-placeholder {
color:#090;
background:lightgreen;
text-transform:uppercase;
}
#field4::-webkit-input-placeholder {
font-style:italic;
text-decoration:overline;
letter-spacing:3px; color:#999;
}
/* mozilla */
#field2:-moz-placeholder { color:#00f; }
#field3:-moz-placeholder {
color:#090; background:lightgreen;
text-transform:uppercase;
}
#field4:-moz-placeholder {
font-style:italic;
text-decoration:overline;
letter-spacing:3px;
color:#999;
}
Chrome 10 (Win 7) | Chrome 11 (Win 7) | Firefox 4 (Win 7) | Safari 3.1 (Win XP & OS X) | Safari 5 (Win 7 & OS X) | Opera 11 (Win 7) | |
background-color | not | not | + | not | + | not |
border | not | not | + | not | + | not |
color | + | + | + | not | + | not |
font-size | + | + | + | not | + | not |
font-style | + | + | + | not | + | not |
font-weight | + | + | + | not | + | not |
letter-spacing | + | + | + | not | + | not |
line-height | not | not | not | not | not | not |
padding top / bottom | not | not | + | not | + | not |
padding left / right | not | not | + | not | not | not |
text-decoration | not | not | + | not | + | not |
text-transform | not | not | + | not | + | not |
Source: https://habr.com/ru/post/120152/
All Articles