HTML Reference HTML by Alphabet HTML by Category HTML Browser Support HTML Attributes HTML Global Attributes HTML Events HTML Colors HTML Canvas HTML Audio/Video HTML Character Sets HTML Doctypes HTML URL Encode HTML Language Codes HTML Country Codes HTTP Messages HTTP Methods PX to EM Converter Keyboard Shortcuts ::placeholder { But thanks to the ::placeholder pseudo element you can change this to fit your needs.If you are not familiar with pseudo element selectors they are typically prefixed by ::. For our purposes I have defined a series of rules to change the color of different placeholders text.A problem presented by the ::placeholder pseudo element is it is not a standard selector, yet. While using this site, you agree to have read and accepted our When the input field is selected the conditional statement is used that sets back to empty value and black colored text only if the “hasText” is false which is set by the following onblur event. Sometimes you might see a single :, but the may only a… In this above HTML, similar to previous section value has been used as placeholder with color set to red. To change this, style the placeholder with the non-standard If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail: In most browsers, the placeholder text is grey. email@example.com is placeholder … The key is knowing how to define selectors to create style rules for the place holder text and input elements.You should also accept this is a progressive enhancement. Normally, HTML input field placeholder text is rendered using default styles and a slightly gray color. HTML5 introduced a new attribute called placeholder. This can reduce the chances of input errors, forgotten values and just making forms more usable.We use cookies to give you the best experience possible. The key to applying special colors and other styling to an HTML input's placeholder text is defining unique rules for the ::placeholder pseudo elements. This attribute on and