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

1
2
3
4
5
6
7
8
9
<div>	
	<p><input type="search" placeholder="My First Name" class="firstField"/></p>
	<p><input type="search" placeholder="My Middle Name"  class="secField"/></p>
	<p><input type="search" placeholder="My Last Name"  class="thirdField"/></p>
	<p><input type="search" placeholder="My Age"  class="fourthField"/></p>
	<p><input type="search" placeholder="My Address"  class="fifthField"/></p>
	<p><input type="search" placeholder="My WorkPlace"  class="sixthField"/></p>
	<p><input type="search" placeholder="My Occupation"  class="seventhField"/></p>
</div>

Css of The Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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

Recently Published

»

Modern Changes That You Should Consider for Your Web Site

Websites need to modernize and get updated periodically otherwise ...

»

Super Tips For A Flawless Website

A website has a specific purpose. And your job is to design a website ...

»

Wix Offers Best Free Web Apps for Artists and Photographers

The famous online website builder Wix is known for providing the ...

»

What You Should Know Before Setting Up a Digital Marketing and Web Design Company

Running a digital marketing and web designing company can be a ...

»

Important Factors to Think About When Starting a Mailing List

Many bloggers and business owners don’t have a mailing list, ...

»

Tried and Tested Strategies for Boosting eBook Sales

As you have by now realized, writing your ebook was just the first ...

»

What Really Makes a Website User-Friendly

Whether it’s for business or personal use, having a website online ...

»

5 Features of Virtual Private Server that put you in complete Control of Your Website

For a decade now, virtual private server has been a preferred hosting ...

»

8 Ways the Right Ecommerce Platform Makes Your Business Perform Better

Starting your own ecommerce store is an exciting experience, but ...