CSS ::placeholder Selector

❮ Previous Selectors Next ❯

Example

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

Meaning

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.




Status







❮ Previous Selectors Next ❯