Make Long CSS Selectors Short With is() And where()

Date:


In this video you’ll learn how to simplify your CSS code, turning long verbose selectors into something much more efficient with the :is() and :where() pseudo-classes.

For example, let’s say you use the following selectors to target a bunch of heading elements on the page and make them all serif:

That’s quite messy. But using the :is() pseudo class function we can change all that into this:

.That’s just one example. Check out the video to see more, along with explanations of how :is() works, and how it goes hand in hand with the :where() pseudo class too!


CSS Fan? Check Out These Videos!

If we haven’t met before my name’s Adi and I’m a web designer. It’s my goal with these videos to help you become a better web designer and developer!

Resources



Source link

About Author

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Share post:

Subscribe

spot_imgspot_img

Popular

More like this
Related

10 Tips for Implementing Webflow On-page SEO — SitePoint

SEO is crucial for your website. After all,...

Frontend Rewind 2023 – Day 04

Step into Day 4 of “Frontend Rewind 2023”!...