How to apply styling to placeholder text?

Formatting placeholder text using CSS

We should use browser prefix CSS for achieving cross browser compatibility.

CSS


/* placeholder css */
::-webkit-input-placeholder {  
  color: #BBBDBF; /* chrome, safari */
}
::-moz-placeholder { /* Firefox 19+ */
  color: #BBBDBF;
}
:-ms-input-placeholder { /* IE 10+ */
  color: #BBBDBF;
}
:-moz-placeholder { /* Firefox 18- */
  color: #BBBDBF;
}

Demo

See the Pen Apply styling to input placeholder text by Vinothkumar Rajendran (@fedtutorial) on CodePen.0

You may also like

Leave a Reply

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