Skip to content

CSS

New and old pseudo selectors

List of all pseudo selectors on MDN

Pseudo selectorsExplanationCan I Use
:is()Takes a list of selectors and applies the styles to any element matching one or more of the selectors.caniuse: :is()
:where()Similarly to :is(), but with zero specificity.caniuse: :where()
:not()Excludes elements that match a specified selector.caniuse: :not()
:has()Parent selector that matches based on child elements.caniuse: :has()
:emptyTargets elements that do not have any children, including text nodes.caniuse: :empty
:focus-visibleApplies styles to elements when they gain focus, but only if the focus was visible like with keyboard navigation.caniuse: :focus-visible
:focus-withinApplies styles to an element if any of its descendants have focus.caniuse: :focus-within
::backdropAllows styling the background layer of elements like <dialog> or fullscreen elements.caniuse: :backdrop