CSS :has is a new selector that lets us select the parent of a specific element. It can be used to check if a parent contains at least one element, or one condition like if an input is focused. At the time of writing, :has works in Chrome 15 and Safari 15.4.
Table of contents
Table of contentsThe problemIntroducing CSS :has selectorThe :has selector is not only about the parentBrowser supportCan we use it as an enhancement?Use cases for CSS :hasConclusionFurther resources3 Comments
Sort: