[Css3] How to customize the placeholder text color,
Yesterday I wrote an article about implementing ie browser compatibility with placeholder Based on jquery. Click the portal for details. However, it is still a little flawed, that is, the placeholder text color cannot be set. This article describes how to use css to modify the placeholder text color.
For ie browsers, we can directly modify the style of the span label using the custom class name. For other browsers, such as Google and Firefox, special processing is required. If you don't need to talk about it, go directly to the Code:
Css:
:-Webkit-input-placeholder {color: # f00; }::-moz-placeholder {color: # f00 ;}:-moz-placeholder {color: # f00 ;}
According to the prefix, we know that the first line of code is used in Google's browser, and the last two lines of code are used in Firefox, where:-moz-placeholder is used in Mozilla Firefox 19 +, while: -moz-placeholder is used in Mozilla Firefox 4-18. As follows: