...

View Full Version : Specific CSS?



ajhauser
08-02-2012, 03:23 PM
Hello,
I recently came across a stylesheet with the following line:


ul#nav > li > a:hover

This got me wondering - what is the difference between that and this?


ul#nav li a:hover

Any ideas?
Thanks

VIPStephan
08-02-2012, 03:58 PM
The second rule will select anchors in list items on any level while the first selects only direct children.



<ul id="nav">
<li>
<a>link selected with rule 1 & 2</a>
<ul>
<li><a>link selected with rule 2 only, ignored by rule 1</a></li>
</ul>
<li>
</ul>

ajhauser
08-09-2012, 04:35 PM
Got it - awesome! Thank you.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum