Mastering :has() to Expand Your CSS Skills

Kevin Powell on YouTubeWatch on YouTube

SaveMark complete

Sign in to save videos and track what you’ve finished.

IntermediateUIWeb Design16 min

About this video

A CSS tutorial walking through practical uses of the :has() pseudo-class, including theming, styling form hints, counting child elements and conditional-style patterns. It suits developers who already write CSS and want to use the selector in real interfaces.

What you’ll learn

  • Use :has() to change a parent's styles based on its children
  • Style form hints based on the state of their inputs
  • Count child elements to style lists and layouts with CSS alone