Pseudo-Class Selectors
Pseudo-classes select elements based on their state or position in the document tree. They are prefixed with a single colon (:).
User-Action Pseudo-Classes
:hover activates when the pointer is over an element. :focus activates when an element receives keyboard or mouse focus. :active fires during a click.
Structural Pseudo-Classes
:first-child, :last-child, :nth-child(n), and :nth-of-type(n) select elements by their position among siblings. :not(selector) negates a selector.
Form-State Pseudo-Classes
:checked, :disabled, :required, :valid, and :invalid reflect the current state of form controls.