Input
Pseudo-classes which apply to form elements:
:autofill
applies once an element has been autofilled by the browser.:enabled
applies if the user can interact with the control.:disabled
applies if the control is disabled.:read-only
applies if the control is disabled or read-only; the user can't edit the input's value.:read-write
applies if the input is not disabled or read-only.:placeholder-shown
matches inputs showing placeholder text.:default
matches inputs that are default::checked
applies to checkboxes and radio buttons that are selected.:indeterminate
applies to checkboxes with theindeterminate
attribute set.:blank
matches an input containing an empty string or other null/empty input.:valid
matches inputs with valid contents.:invalid
matches inputs with invalid contents.:in-range
applies to range inputs with a value in the permitted range.:out-of-range
applies to range inputs with a value outside the permitted range.:required
matches required inputs.:optional
matches optional inputs.:user-invalid
matches inputs which are invalid, but only once a user has interacted with it.
Backlinks