It works correctly if I close the li before starting the nested list, but as I understand that's not semantically correct. I want it to be correct, so my question is - is there a way I can target that one element without having the nested list pick up the styles?
Here's my relevant css:
- Code: Select all
ul, li { /* reset */
margin:0;
padding:0;
}
#menu {
width: 230px;
background: #efefef;
}
#menu ul {list-style-type: none;}
#menu li{
padding-left: 1em;
}
#menu li.active {
background: yellow;
}
#menu li a {
color: orange;
}
#menu li a.active {
background: url(arrow.png) no-repeat left center;
padding: 1.25em;
}
}
And my html:
- Code: Select all
<div id="menu">
<ul>
<li><a href="#">Item 1</a></li>
<li class="active"><a href="#" class="active">item 2</a>
<ul>
<li><a href="#">Nested Item 1</a></li>
<li><a href="#">Nested Item 2</a></li>
</ul>
</li>
</ul>
</div>
(arrow.png is a 9x9 graphic, if that helps)
Any help on this would be greatly appreciated. It's probably an easy fix, but it's just not coming to me!
Thanks!!
