How to change an HTML5 input’s placeholder color with CSS?

Sometimes, we want to change an HTML5 input’s placeholder color with CSS.

We’ll look at how to change an HTML5 input’s placeholder color with CSS, in this article.

How to change an HTML5 input’s placeholder color with CSS?

First we use the ::placeholder selector, to change an HTML5 input’s placeholder color with CSS.
For instance, we write

::placeholder {
  color: #909;
}

to set the input placeholder’s color to #909.

Conclusion

Lastly, we use the ::placeholder selector, to change an HTML5 input’s placeholder color with CSS.

Leave a Reply