You can use ::placeholder
pseudo in CSS, like this example:
::placeholder { color: #fff; }
If you want a cross-browser solution, you can use prefixes:
::-webkit-input-placeholder { /* Chrome/Opera/Safari */
color: #fff;
}
::-moz-placeholder { /* Firefox 19+ */
color: #fff;
}
:-ms-input-placeholder { /* IE 10+ */
color: #fff;
}
:-moz-placeholder { /* Firefox 18- */
color: #fff;
}
The ::placeholder
selector only selects the placeholder text inside your input, besides that, you can style the input itself when it is showing the placeholder using :placeholder-show
.
Also, be aware that Firefox might show placeholder text lighter than it is supposed to display. to fix the issue you can use:
::-moz-placeholder {
opacity: 1;
}