Skip to content
UPEEC

Pseudo-Classes

Select elements by state or position: `:hover`, `:focus-visible`, `:checked`, `:disabled`, `:first-child`, `:nth-child(2n)`, `:not()`, `:is()`, `:has()`.

Easy
Comments 0

:has() is a "parent selector": .card:has(img) { padding: 0; }.

Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.

Discussion (0)

Sign in or join free to ask questions and discuss this topic.