The CSS :has() selector

The :has() selector is really powerful and has so many interesting use cases. If you're looking to get a better understanding of how it works and what can do, you'd be hard pressed to find a better article than this one by Ahmad Shadeed:

CSS :has() Interactive Guide
Everything you need to know about CSS :has() selector.

Update 19/03/2024
Here are some more cool use cases from Andy Bell:

Some little ways I’m using CSS :has() in the real world

Like this post? Got a question?

Reply via Bluesky or Email.