by Wowfunhappy · 4y ago · 0 comments
parent:has(child)
Instead of parent < child
Which seems a bit more intuitive to me given that the inverse is a thing.You can also match descendants of something with the :has() selector. It really is more than a “parent selector”
div:has(b) a
which matches a link inside a div that also contains bold text. The important part is that 'b' and 'a' can be very different places in the hierachy, they don't need to be same like like a 'b + a' selector.