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

»

8 Ways the Right Ecommerce Platform Makes Your Business Perform Better

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

»

The SSL certificates and why are they essential for sites

What are SSL and its purpose? SSL is a modern technology that is ...

»

Entering Into M-Commerce as a Small Business

According to a December 2016 Business Insider article, the U.S. ...

»

How to Convert More Traffic Quickly and Easily

If you’ve got a blog that gets plenty of traffic but ...

»

Strengthen Workplace Productivity with Live Chat Software

Live chat has become an important part of every company’s customer ...

»

How More Powerful Smartphones Are Making Websites Load Faster

Smartphone speeds keep accelerating. Last October, Qualcomm joined ...

»

The Most Effective Method To Present A Logo Plan

The Most well-known creators’ battles are and how they are ...

»

Sure Guide for Improving Your WP Site Accessibility

This article compiles some best practices to optimize a WP site ...

»

9 Social Media and Marketing Tools Recommended for a Business

A business is set up to have a profit by delivering a product or a ...