The CSS :has pseudo-class is a new and powerful tool that enables styling of parent elements based on their children, working in a 'bottom-up' fashion. This capability opens up numerous possibilities, such as cleaner state-based styling and global event detection without JavaScript. Although it offers compelling advantages, its

14m read timeFrom joshwcomeau.com
Post cover image
Table of contents
Table of ContentsLink to this heading The basicsLink to this heading Browser supportLink to this heading Styling based on statesLink to this heading Global detectionLink to this heading The missing selectorLink to this heading The best tool for the job
17 Comments

Sort: