Css only for the first direct child
I have the following html structure:
<div class="nav-collapse">
<ul class="nav">
</ul>
<ul id="registerCart" class="nav pull-right">
</ul>
</div>
and I wanted to apply the following rule only to the first nav, so I did:
.nav-collapse > .nav {
left: 135px;
}
however, this is also case-sensitive. How to apply this only to the first nav?
0
3 answers
p > , , ( , ) , , .
: first-child , IE7 IE8, . . http://www.quirksmode.org/css/selectors . , class id.
+1