Menu Close

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

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.

Posted in CSS