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

<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

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

»

Docker: How To Build Better Development Security With It

The top concern among developers and DevOps teams is security within ...

»

Mobile Development: How to Reduce Costs

Modern markets have become so competitive that it has become vital ...

»

Know-How DevOps Benefits Your Business

The organizations in this current fast-paced environment need to ...

»

10 Best Prototyping Tools for UI/UX Designers

Website design for a client gets only successful if you follow their ...

»

Social Media Marketing: Strategy To Boost Ecommerce-Traffic

According to a recent study, the experts revealed that people aged ...

»

How Flutter Can Help Reduce Overall Mobile App Development Cost?

Before jumping on answering the question, let me first walk you ...

»

Which One is Better? DigitalOcean Or AWS?

Digitalocean or AWS: Picking a cloud service for your application or ...

»

Killing way to select Domain Name and Hosting

Planning to launch your online presence? We know it’s all very ...

»

7+ blogs to inspire how they made more than $200 in a day

On this page I want to go through the blogs on how they earn money ...