I am calling wp_list_categories within a pair of UL tags and this is creating me a nice list of categories.
Now I want to be able to have a different background colour for each item (li).
If I were to manually create the list I could do something like the following:
<ul> <li class="red"><a href="cat1Link">Cat 1</a></li> <li class="blue"><a href="cat2Link">Cat 2</a></li> <li class="green"><a href="cat3Link">Cat 3</a></li> </ul>
and then set up my CSS to alter the background colour based on the li class.
When using wp_list_categories the li comes out like:
<li class="cat-item cat-item-33">
So I could set the CSS to alter the colours based on the cat-item-xx codes but that seems wrong to me as the CSS would not be nice and generic and would require changing each time it was used.
What would be good is if there was a more dynamic method. Something like a CSS that changes each use, so first use it specifies the colour would be red, the second blue, the third green and then cycle back around.
Any idea if that is possible or if there is another way of achieving this effect.