CSS :placeholder-shown Selector

❮ Previous Selectors Next ❯

Example

input:placeholder-shown {
  border-color: red;
}

Meaning

The :placeholder-shown selector selects <input> or <textarea> element that is currently displaying placeholder text.

Version: CSS3




Standard Syntax

:placeholder-shown {
  css declarations;
}



Browser Support

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




Status







❮ Previous Selectors Next ❯