CSS ::placeholder Selector

❮ Previous Selectors Next ❯


.example::placeholder {
  color: red;
  font-style: italic;


The ::placeholder selector selects the placeholder text in an <input> or <textarea> element.

Only the subset of CSS properties that apply to the ::first-line pseudo-element can be used in a rule using ::placeholder in its selector.

Note: In most browsers, the appearance of placeholder text is a translucent or light gray color by default.

Version: CSS3

Standard Syntax

::placeholder {
  css declarations;

Browser Support

The numbers in the table specify the first browser version that fully supports the property.


❮ Previous Selectors Next ❯