CSS previous sibling selectors and how to fake them

Facundo Corradini / filed under HTML & CSS

If you ever used CSS sibling selectors, you know there’s only two. The + sibling combinator selects the first match that comes immediately after, and the ~ subsequent-sibling combinator matches all the ones that come after. But there’s no way to select what came before. Either parent selectors or previous siblings selectors are simply not […]

Subscribe to newsletter

Best design and frontend links delivered to your inbox every day and week. No spam, unsubscribe at anytime.

Choose frequency

Permission
Privacy Policy