Mia Mia - 3 months ago 9
CSS Question

CSS "and" selector - Can I select elements that have multiple tags?

I'm trying to select all of the elements that have both

.checked
and
.featured
tags. So basically, what I'm looking for is an "and" selector; I don't know if there is one or not.

Is there any workaround for cases like this?

Answer

You use both (without space between them)

.checked.featured{
   // ...
}

Reference: http://www.w3.org/TR/selectors/#class-html

Comments