CSS :has() Selector Playground
Selectors:has() is the CSS parent selector. Style an element based on what it contains or what follows it, without walking the DOM in JavaScript.
has browser support
Widely availableSince 202394% of people can use this
This feature is well established and works across many devices and browser versions. It has been available across browsers since 2023.
Safe to use without fallbacks.