Today I Learned

CSS :has() selector is a game changer

The :has() pseudo-class lets you select a parent element based on its children. For example, div:has(img) selects all divs containing an image. This was previously impossible in pure CSS and required JavaScript. Browser support is now excellent.

View source

0 Comments

Sign in to leave a comment

No comments yet. Be the first!