DEV Community

Cover image for A use-case for CSS :has()

A use-case for CSS :has()

Cassidy Williams on November 19, 2023

In case you missed it, the CSS :has() selector is now supported in all major browsers! It's a very weird (but cool) selector that allows you to se...
Collapse
 
keyurparalkar profile image
Keyur Paralkar

Interesting Article!

Collapse
 
oskargrosser profile image
Oskar Grosser • Edited

Glad you found a solution that works for you!

Actually, the background-color value of body will propagate to html if it is transparent on html; see [CSS-BACKGROUNDS-3] § 2.11.2. Simply remove the declaration on html and it should (hopefully) work the same!