Reputation: 22557
I have been looking at the w3 page on css selectors and have not found any promising leads, so I thought I would ask...
Is there a way to style a single element with two classes differently than if it was one class?
Example:
a.foo {
color: red;
}
a.bar {
color: yellow;
}
a.foo.bar {
color: orange;
}
<a class="foo">Red</a>
<a class="bar">Yellow</a>
<a class="foo bar">Orange</a>
Upvotes: 32
Views: 27110