i want to apply the CSS only first li but :first-child apply to all first child of every ul
here is my CODE
#menu-navigation li:first-child{
color:red;
}
When applied to this HTML:
<ul class="nav" id="menu-navigation">
<li>Home</li>
<li>About Us
<ul>
<li>Our Team</li>
</ul>
</li>
</ul>
…both “Home” and “Our Team” turn red.
use the child selector:
For example: http://jsfiddle.net/w47LD/3/