Thursday, 15 August 2013

Alternate row colors between two divs

Alternate row colors between two divs

I'm not sure if this is possible in CSS, but if it is, I would appreciate
some help.
I have HTML similar to the following:
<div class="group"></div>
<div class="group"></div>
<div class="group subgroup"></div>
<div class="row"></div>
<div class="row"></div>
<div class="group"></div>
<div class="group subgroup"></div>
<div class="row"></div>
Is it possible to alternate the background colors of the row classes?
Always starting with the same color? I've been having trouble achieving
this using nth-child and I'm assuming it's because of the group/subgroup
classes.
Manual html markup in jsfiddle of an example data set that could be
returned and how it is designed to be styled: http://jsfiddle.net/Qr5Za/

No comments:

Post a Comment