In-Depth Guide to CSS Parent Selector :has()

VideoZoran Jambor

Learn how :has() pseudo-class works and how it can help you create complex UI interactions without tweaking HTML or using JavaScript.

Learn how :has() pseudo-class works and how it can help you create complex UI interactions without tweaking HTML or using JavaScript.

Additionally, find out how you can use :has() to create a fascinating hover effect that would otherwise be impossible without quite a lot of JavaScript.

Chapters

  • 00:00 Intro
  • 00:27 How :has() works
  • 03:40 How to select a previous sibling
  • 04:55 Combining :has() with :not()
  • 05:37 How to test if a browser supports :has()
  • 06:19 Create a staircase hover effect
  • 09:00 Conclusion

Demos

Links

CSS Stickers

CSS Stickers

A set of beautiful, cute, and funny CSS stickers to showcase your love for CSS.

Get Your Set Today »
CSS Weekly YouTube Channel

CSS Weekly YouTube Channel

Weekly hands-on tutorials, tips, tools, news, and more — everything related to CSS and front-end development, created by Zoran Jambor.

Subscribe Today »