How come both links get bold with this setup?
I would like that only the a-tag just below the li.current get bold.
CSS
.ul li.current a:first-child{
font-weight:bold;
}
Html
<ul>
<li class="current">
<a href="">This link</a>
<ul>
<li>
<a href="">Not this</a>
</li>
</ul>
</li>
</ul>
Use:
jsFiddle example
The
>refers to the immediate child. So while your rule was being applied to any anchor that was a child, the above rule only applies to the immediate children oful li.current. Note that you may also be able to drop the:first-childpart depending on how you want your links formatted.Also note that in your code you have
.ulwhere you probably just wantedulas is in my example.