Questions tagged [placeholder]

The HTML5 placeholder attribute specifies a short hint that describes the expected value of an input field (e.g. a sample value or a short description of the expected format). The hint is displayed in the input field when it is empty, and disappears when the field gets focus.

In HTML5 the placeholder attribute specifies a short hint that describes the expected value of an input field (e.g. a sample value or a short description of the expected format).

The hint is displayed in the input field when it is empty, and disappears when the field gets focus.

For example:

<input type="text" placeholder="Hello, world!" />
2050 questions
4350
votes
42 answers

Change an HTML input's placeholder color with CSS

Chrome v4 supports the placeholder attribute on input[type=text] elements (others probably do too). However, the following CSS doesn't do anything to the placeholder's value: input[placeholder], [placeholder], *[placeholder] { color: red…
David Murdoch
  • 87,823
  • 39
  • 148
  • 191
1994
votes
42 answers

How do I make a placeholder for a 'select' box?

I'm using placeholders for text inputs which is working out just fine. But I'd like to use a placeholder for my selectboxes as well. Of course I can just use this code: