因为每个浏览器的CSS选择器都有所差异,所以需要针对每个浏览器做单独的设定(可以在冒号前面写input和textarea)
::-webkit-input-placeholder { /* WebKit browsers */
color:#999;
}
:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
color:#999;
}
::-moz-placeholder { /* Mozilla Firefox 19+ */
color:#999;
}
:-ms-input-placeholder { /* Internet Explorer 10+ */
color:#999;
}
::-webkit-input-placeholder { /* WebKit browsers */
color:#999;
}
:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
color:#999;
}
::-moz-placeholder { /* Mozilla Firefox 19+ */
color:#999;
}
:-ms-input-placeholder { /* Internet Explorer 10+ */
color:#999;
}