The :has() pseudo-class has far greater range than just styling an element’s ancestor. It's a great time for you to become familiar with it! Continue reading An Introduction to the :has() Selector in CSS on SitePoint.