CSS selector input test grid

inopinatus

There are many opportunities to respond to interactive page state in pure CSS. Many (not all) rely on selectors against input types. I put this table together whilst building up a CSS-centric page automation toolkit, for examining opportunities for stateful behaviours and transitions in web pages using little or no Javascript.


Selectors tested: :active :checked :default :disabled :enabled :focus :focus-within :hover :in-range :indeterminate :invalid :optional :out-of-range :placeholder-show :read-only :read-write :required :target :valid :link :visited :any-link [open] :not([open])

Type state
Element
Selectors
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
 
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
Text input variants
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
 
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
 
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
Radio input variants
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
Other elements
Element
Selectors
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
summary details
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
[open]
:not([open])
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
[open]
:not([open])
span
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
Trigger
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
[open]
:not([open])
Trigger
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
[open]
:not([open])
Trigger
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
[open]
:not([open])
https://inopinatus.org
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
[open]
:not([open])
http://www.random.none
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
[open]
:not([open])
:active
:checked
:default
:disabled
:enabled
:focus
:focus-within
:hover
:in-range
:indeterminate
:valid
:invalid
:optional
:out-of-range
:placeholder-shown
:read-only
:read-write
:required
:target
:visited
[open]
:not([open])