Ultimate Web Tips
your Wordpress, jQuery, PHP, MySQL, Linux and CSS guide to a successful website
Read more:

February 13th, 2012

Style HTML5 placeholder color with CSS

CSS, by Joakim Ling.

Placeholder CSS stylingFor now this is only possible in Webkit and Mozilla browsers, the discussion about best implementation is still an ongoing project.

You’ll have to use 2 rules, as the standards for this is not been set yet.

For Mozilla:

:-moz-placeholder { color: #000000; }

And for Webkit:

::-webkit-input-placeholder { color: #000000; }

This goes for both input and textareas.

Chrome 9 & 10

Do not support background-color, border, text-decoration and text-transform when styling the placeholder.

Summary of CSS properties supported

Chr 9-11
(Win 7)
Chr 15
(Win 7)
FF 4-8
(Win 7)
Saf 3.1
(Win XP & OS X)
Saf 5
(Win 7 & OS X)
Saf 5.1
(Win 7)
Opera 11
(Win 7)
background-colorNoYesYesNoYesNoNo
borderNoYesYesNoYesNoNo
colorYesYesYesNoYesYesNo
font-sizeYesYesYesNoYesYesNo
font-styleYesYesYesNoYesYesNo
font-weightYesYesYesNoYesYesNo
letter-spacingYesYesYesNoYesYesNo
line-heightNoNoNoNoNoNoNo
padding top/bottomNoYesYesNoYesNoNo
padding left/rightNoNoYesNoNoNoNo
text-alignNoYesYesNoNoNoNo
text-decorationNoYesYesNoYesNoNo
text-transformNoYesYesNoYesNoNo

If you find a hack or a workaround for other browsers please let me know.

Easy Starter CSS Templates

Web design has never been easier with these static, Html/css templates. Choose between two or three column and select from over 50 high-res headers and 70 custom backgrounds. Read more

Back Top

Club World Casinos