I am working with a structure that looks like this:
<div class="wrapper"...>
<a href="#"...>blah</a>
<div class="post"...>stuff</div>
</div>
This structure repeats multiple times on a dynamic page. I am looking for a way to alternate the background colors of the div with class "post" using two different colors. However, CSS's nth-child pseudo class only works with directly sequential items.
Can someone suggest a solution (CSS, Javascript, jQuery, etc.) to achieve alternating div background colors?