Subtleties with Self-Chained CSS Classes (csswizardry.com)
almost 8 years ago from Catalin Cimpanu
almost 8 years ago from Catalin Cimpanu
Chaining classes doesn’t actually count (or look out for) n classes in your markup
Right, but why would it? Chained selectors is basically an AND question, i.e.:
section#this.that
is any section
with an id
of this
AND a class of that
, so
section.colour.colour
is any section
with a class
of colour
AND a class
of colour
so of course it doesn't match class="colour colour"
as having two colour
classes.
Anyway, that's a silly way to do things.
the answer to a question no one should ever ask.
This is how you get away with !important —without using important.
Designer News
Where the design community meets.
Designer News is a large, global community of people working or interested in design and technology.
Have feedback?
Login to Comment
You'll need to log in before you can leave a comment.
LoginRegister Today
New accounts can leave comments immediately, and gain full permissions after one week.
Register now