Does CSS have a selector for selecting when in more than one class? [duplicate]
I have the following:
<a class="nav disabled">Test</a>
Is there some way I can specify the background-color if the address has BOTH the "nav" and "disabled" class markers? In other words a selector that will select only the last of the three below:
<a class="nav">Test1</a>
<a class="disabled">Test2</a>
<a class="nav disabled">Test3</a>
Yes.
.nav.disabled { .... }
this has side effects in IE6, but is otherwise supported by every browser.
Concatenate the class selectors:
a.nav.disabled
CSS rule for
<a class="nav disabled">Test3</a>
is
a.nav.disabled {}
or
.nav.disabled {}
精彩评论