Pseudo-Classes and Pseudo-Elements
Pseudo-Classes and Pseudo-Elements: Pseudo-Classes: :hover, :focus-visible, :nth-child() and More, Pseudo-Elements: ::before, ::after and ::marker, Modern…
Updated
- Pseudo-Classes: :hover, :focus-visible, :nth-child() and More (Apprentice): Pseudo-classes select elements by their state, such as hovered, focused, checked or disabled, or by their position, such as first, last or every other, and :not() leaves some out.
- Pseudo-Elements: ::before, ::after and ::marker (Apprentice): Pseudo-elements style a part of an element, or add decoration before or after it, such as a play icon, a quote mark, a list's numbers, a text box's placeholder or highlighted text, without changing the HTML.
- Modern Selectors: :is(), :where() and :has() (Journeyman): The :is() and :where() pseudo-classes shorten long selector lists, :where() with no specificity at all, and :has() styles an element by what it contains, so a page can react to a click with no JavaScript.