How CSS level 4 selectors could boost devs’ powers

Read more about How CSS level 4 selectors could boost devs’ powers at CreativeBloq.com


Times are changing. CSS is becoming a kind of Swiss Army knife for the web. We can already use a range of helpful selectors such as :nth­child, :nth­of­type and :not() to target specific DOM elements. With CSS level 4 selectors, there will be an extra layer of power. Firstly, there’s the :matches pseudo­class. We can use it to match an element against a list of selectors. For example, if we want to apply the same link colour to the different states of an anchor, we can simply do:




Creative Bloq

Leave a Comment