Change a HTML5 input's placeholder color with CSS
Asked 07 September, 2021
Viewed 2.6K times
  • 57
Votes

Chrome supports the placeholder attribute on input[type=text] elements (others probably do too).

But the following CSS doesn't do anything to the placeholder's value:

input[placeholder], [placeholder], *[placeholder] {
    color: red !important;
}
<input type="text" placeholder="Value">

But Value will still remain grey instead of red.

Is there a way to change the color of the placeholder text?

30 Answer