Select elements by class using nth-of-type
<p>I'm trying to use <code>nth-of-type</code> to set a gray background for every other <code>.time</code> and <code>.title</code> element (odd/even pattern).</p>

<pre><code> &lt;div class="calendar"&gt;
     &lt;div class="time"&gt;Gray Background&lt;/div&gt;
     &lt;div class="title"&gt;Gray Background&lt;/div&gt;
     &lt;div class="time"&gt;White Background&lt;/div&gt;
     &lt;div class="title"&gt;White Background&lt;/div&gt;
     &lt;div class="time"&gt;Gray BG&lt;/div&gt;
     &lt;div class="title"&gt;Gray BG&lt;/div&gt;
     &lt;div class="time"&gt;White Background &lt;/div&gt;
     &lt;div class="title"&gt;White Background&lt;/div&gt;
 &lt;/div&gt;
</code></pre>