CSS:has() is behind a flag in Firefox and supported in Chrome, Edge, and Safari. It can match an ancestor element based on containing a specific descendant, but it can also match antecedent elements based on subsequent content. In the following pseudo-code, you can select any that has a later sibling.

9m read timeFrom 12daysofweb.dev
Post cover image
Table of contents
Functional pseudo-classSelector ListSpecificityRelative selectorLogical operationsUsefulnessAvoiding failureEstelle Weyl
1 Comment

Sort: