The :has()
CSS pseudo-class represents an element if any of the selectors passed as parameters (relative to the :scope
of the given element) match at least one element.
The :has()
CSS pseudo-class represents an element if any of the selectors passed as parameters (relative to the :scope
of the given element) match at least one element.
:has( <forgiving-relative-selector-list> )
The :has()
pseudo-class takes a relative selector list as an argument.
Specification |
---|
Selectors Level 4 # relational |
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
:has |
105 |
105 |
103 |
No |
91 |
15.4 |
105 |
105 |
No |
No |
15.4 |
No |
© 2005–2022 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/:has