CSS :nth-child Equation
- by Meander365
I have an unordered list and each li makes up one item in a two column layout:
col1 col2
1 2
3 4
5 6
7 8
9 10
11 12
I need to have an alternating background colour for each item BUT NOT so each item in one column is the same.
So :
1,4,5,8,9,11 will have one colour; and
2,3,6,7,10,12 will have another colour.
Can this be achieved with one :nth-child rule?
Thanks!