The.has() pseudo-class is a level 4 CSS selector, now available as a fully supported feature in Chrome 105 onwards. It works on the parent rather than children, and uses a comma-separated list of selectors as arguments. The class.selector only gets selected if it contains the elements passed to it as parameters using the has()

9m read timeFrom blog.logrocket.com
Post cover image
Table of contents
Why is the :has() selector necessary?Enabling support for the :has() selectorWhat does the CSS :has() selector do?Usage scenariosChecking for browser supportConclusionIs your frontend hogging your users' CPU?

Sort: