4 ms·
The article gives a few examples where a pseudo-class fits better with how CSS normally works. For example, the selector matches the last item in the selector.
by henrikeh 4y ago
The article gives a few examples where a pseudo-class fits better with how CSS normally works. For example, the selector matches the last item in the selector. With ‘<‘ it would match ‘parent’ in your case.
You can also match descendants of something with the :has() selector. It really is more than a “parent selector”
- silvestrov 4y agoExample of this: 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.