13
In HTML5, we can make use of the attribute placeholder
(English) in order to give the user a hint about the type of data that a given field accepts.
To avoid confusion between data actually written by the user and the text with the instructions, I would like to apply a different color to the text of the placeholder
.
<input type="text" placeholder="Primeiro e Último nome apenas" value="John Doe">
<!-- └────────────────────┬────────────────────┘ └──────┬───────┘
color: #ccc color: #444
-->
Question
Using only CSS, how can we define the color for the placeholder
without affecting the colour defined for the value
in a way that works in the various browsers ?