For about twenty years the answer to "how do I style a parent based on its children? " was "you can't, use JavaScript". Then :has() arrived, and it has now been supported in every major browser for long enough that you can use it without a second thought.

Source: [Dev.to](https://dev.to/accreditly/practical-uses-for-css-has-now-that-it-works-everywhere-4ccf)

Sponsored