Categories
CSS

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

Spread the love

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

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

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

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

For instance, we write

::placeholder {
  color: #909;
}

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

Conclusion

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

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

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