Alternating List Background Colors

sara.ortiz

New Member
I designed the Danville, IL YMCA website. (http://www.danvilleymca.org/programs.html) On their programs page we have the classes in a list tag. Each item has a different background color alternating light, dark, light, dark etc. They regularly update this list so whenever I add a new class I have to update the alternating colors as well so there isn't two items with a light background or two items with a dark background right next to each other.

Is there an easier way to do this so I don't have to update the background colors each time? Any ideas would be appreciated.
 

Edge

Member
supported by modern browsers:

li:nth-child(odd) { background-color:#whatever }
li:nth-child(even) { background-color:#amibovvered }
 
Top