Skip to main content

:has(): the family selector (Chrome developers blog)

Direct Link

The :has() CSS pseudo-class represents an element if any of the selectors passed as parameters match at least one element. But, it's more than a "parent" selector. That's a nice way to market it. The not so appealing way might be the "conditional environment" selector. But that doesn't have quite the same ring to it. How about the “family” selector?

The CSS :has() pseudo-class is a game-changer and can do more than act as a parent selector, as Jhey illustrates.

External Link Bookmark Note Entry Search