HTML Setting Active with different background colour
- by danit
Here is my HTML List:
<ul id="navlist">
<li class="item1"><a href="#">One</a></li>
<li class="item2"><a href="#">Two</a></li>
<li class="item3"><a href="#">Three</a></li>
<li class="item4"><a href="#">Four</a></li>
<li class="item5"><a href="#">Five</a></li>
<li class="item6"><a href="#">Six</a></li>
</ul>
Each .itemx has a different background colour, so I need the active state to take into account the class.
Obviously something like:
<li class="item6" id="active"><a href="#">Six</a></li>
#active.item6 {
background: red;
}
Would work but IE6 doesnt like chained items in CSS so doesnt work when other items are set out in the CSS.
Can I do this with jQuery where each item has a different background colour when 'active?