TIL: CSS :has() selector enables parent selection
M
mindweave153 viewsFebruary 27, 2026
The :has() pseudo-class lets you style a parent based on its children. For example, div:has(> img) selects divs that contain an img. This was the most requested CSS feature for years!