How to Style INPUT Element with CSS Using HTML5?

Placeholder Styling with CSS Using HTML5 is not actually something great that you ought to do but yeah definitely it is one among those minor details that will differentiate your website from the other websites. Styling input element is easy and looks cool.

As a website owner you would just want to make use of the most standard styles to the placeholder such as Font Color, Font Style, Font Variant and lots more basic styles. If you wish to go to the extremes of placeholder styling in that case you possibly can create animated GIF format images from input styles.

One important thing that you got to know here is that Mozilla Firefox makes use of a completely different pattern of placeholder styling than Google Chrome and Safari Web Browsers. Apart from this a noteworthy point here is that Mozilla Firefox does not render support for Placeholder Styling with CSS Using HTML5 until its version 4. In this post on WDJ we present you interesting CSS Style Properties that you can use for INPUT placeholder styling.

Let me give you an example on how you can make wonders with some distinct CSS code and style the placeholder text with the INPUT elements.

Html of The Code

        

Css of The Code

input:focus{box-shadow: 10px 10px 5px #888888;}
::-webkit-input-placeholder { color:#f00; }
::-moz-placeholder { color:#f00; } /* firefox 19+ */
:-ms-input-placeholder { color:#f00; } /* ie */
input:-moz-placeholder { color:#f00; }

/* individual: webkit */
.secField::-webkit-input-placeholder { color:#00f; }
.thirdField::-webkit-input-placeholder { color:#090; background:lightgreen; text-transform:uppercase; }
.fourthField::-webkit-input-placeholder { font-style:italic; text-decoration:overline; letter-spacing:3px; color:#999; }
.fifthField::-webkit-input-placeholder { font-style:italic;  text-decoration:underline; letter-spacing:3px; color:red; }
.sixthField::-webkit-input-placeholder { font-style:italic; letter-spacing:3px; color:#000;background:lightblue; }
.seventhField::-webkit-input-placeholder { letter-spacing:3px; color:#000;font-weight:bold; }

/* individual: mozilla */
.secField::-moz-placeholder { color:#00f; }
.thirdField::-moz-placeholder { color:#090; background:lightgreen; text-transform:uppercase; }
.fourthField::-moz-placeholder { font-style:italic; text-decoration:overline; letter-spacing:3px; color:#999; }
.fifthField::-moz-placeholder { font-style:italic; text-decoration:underline; letter-spacing:3px; color:red; }
.sixthField::-moz-placeholder { font-style:italic; letter-spacing:3px; color:#000;background:lightblue; }
.seventhField::-moz-placeholder {  letter-spacing:3px; color:#000;font-weight:bold; }

Check out Demo

Scroll to Top