How do I select every other div class element using just CSS (no js)
.item:nth-child(even) {...}
.item:nth-child(odd) {...}
demo: http://jsfiddle.net/DuL24/1/
You want nth-child()
on .item
.
.item:nth-child(odd) .description {
background-color: red;
}
Demo:
Maybe it's possible when we use this:
.item:nth-of-type(odd) .description{background-color:orange;}
or
.item:nth-child(odd) .description{background-color:orange;}
You can see my screenshots: http://screencast.com/t/17g9joVj8Z
I hope you get what you need.