Style a parent element based on its number of children using CSS :has()
![](https://res.cloudinary.com/aarongustafson/image/fetch/q_100,f_auto,w_100,h_100,c_fill/https%3A%2F%2Fwww.bram.us%2Fwordpress%2Fwp-content%2Fuploads%2F2022%2F11%2Fcss-select-element-based-on-number-of-children.png)
If you were a fan of quantity queries, you’re going to love being able to style a parent element based on how many children it has. Awesome post from Bramus!
:has()
If you were a fan of quantity queries, you’re going to love being able to style a parent element based on how many children it has. Awesome post from Bramus!