comment 0

How to Style HTML5 Placeholder Text?

By default placeholder has gray color. For selecting and styling of placeholder you have to add browser specific prefix CSS properties.

Below prefixes are used to style html5 placeholder text in different browsers.

Chrome

::-webkit-input-placeholder {
   color: red;
}

Firefox version 18(-) or below

:-moz-placeholder {
   color: red;  
}

Firefox version 19(+) or above

::-moz-placeholder {  /* Firefox 19+ */
   color: red;  
}

Internet Explorer

:-ms-input-placeholder {  
   color: red;  
}