Here\'s a PHP example of mine. Can anyone find a shorter/easier way to do this?
foreach($posts as $post){?>
Using CSS3 you can do something like this:
div:nth-child(odd) { background-color: red }
But better not use that for a few years if you actually want your users to see the color...