What are Input Pseudo Classes?

Input pseudo-classes relate to form elements, and enable selecting elements based on HTML attributes and the state that the field is in before and after the interaction.

  • placeholder-shown: Matches an input element that is displaying placeholder text, for example from the HTML5 placeholder attribute.
  • default: Matches one or more UI elements that are the default among a set of elements.
  • checked: Matches when elements such as checkboxes and radio buttons are toggled on.
  • indeterminate: Matches when UI elements are in an indeterminate state