Style Placeholder Text

Placeholder Text in Input has a default light gray Color. You can style it using Vendor prefix CSS Properties.

 

::-webkit-input-placeholder {
   color: red;
}

:-moz-placeholder { /* Firefox 18- */
   color: red;  
}

::-moz-placeholder {  /* Firefox 19+ */
   color: red;  
}

:-ms-input-placeholder {  
   color: red;  
}

You can use it will some CSS Selector like below:

.someInputText::-webkit-input-placeholder {
   color: red;
}

.someInputText:-moz-placeholder { /* Firefox 18- */
   color: red;  
}

.someInputText::-moz-placeholder {  /* Firefox 19+ */
   color: red;  
}

.someInputText:-ms-input-placeholder {  
   color: red;  
}

<input class="someInputText" type"text"/>

Shubham Kumar

Hey, I am Shubham and i love Blogging, Coding and exploring new things and obviously sharing my experience with you.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *