When I check the :has()
CSS selector on caniuse.com, it tells me that since Firefox103 it has been
Supported in Firefox behind the layout.css.has-selector.enabled flag.
So how do I find this flag and enable it?
When I check the :has()
CSS selector on caniuse.com, it tells me that since Firefox103 it has been
Supported in Firefox behind the layout.css.has-selector.enabled flag.
So how do I find this flag and enable it?
:has(...)
selector is not really stable if your css query is dynamic and complicated. For example, :has(:hover div>a[href])
. The browser don't know the triggering of this :hover
css query so that it cannot really perform well. –
Blur CSS.supports ("selector(:has(:focus))"))
returns TRUE, if the value in about:config is enabled, even if it is not working in firefox 1.109+. Than means we can no longer trust on the CSS.supports()
method :( –
Lop On latest version of Firefox version 121, they have implemented the :has()
.
Kindly refer the following link for the updates,
https://www.mozilla.org/en-US/firefox/121.0beta/releasenotes/
© 2022 - 2024 — McMap. All rights reserved.
:has(...)
selector is not really stable if your css query is dynamic and complicated. For example,:has(:hover div>a[href])
. The browser don't know the triggering of this:hover
css query so that it cannot really perform well. – Blur.menu a:has(img){...}
does NOT work but.menu:has(a > img) { ... }
DOES work. – Witchhuntdiv.bc
), a smaller container (call itdiv.sc
), and thea[href]
element. You want to make a css such that, when cursor moves into thediv.sc
that containsa[href]
, the big container will change its background color.div.bc:has(div.sc:hover a[href]){background:red}
. However in reality, Chrome will become very slow to handle this selector, and Firefox will become buggy for the detection. So just avoid using:has
and use JavaScript. – Blur