CSS level 4: matches selector

CSS3 was already something really cool. In version 4, or better saying, in level 4, as it will be divided from now, CSS has many more features. One of them is the :matches selector.

Using it, we could substitute something like that:

For that:

In other words, we get every highlight class that are children of a div or footer.

We could even make the inverse way, as in the example below: we select all p elements that have the success class or that is first-child.

More posts