<p>I need a CSS selector that can find the 2nd div of 2 that has the same class. I've looked at <code>nth-child()</code> but it's not what I want since I can't see a way to further clarify what class I want. These 2 divs will be siblings in the document if that helps.</p>

<p>My HTML looks something like this:</p>

<pre><code>&lt;div class="foo"&gt;...&lt;/div&gt;
&lt;div class="bar"&gt;...&lt;/div&gt;
&lt;div class="baz"&gt;...&lt;/div&gt;
&lt;div class="bar"&gt;...&lt;/div&gt;
</code></pre>

<p>And I want the 2nd div.bar (or the last div.bar would work too).</p>

Selectors can be combined:
```
```
.bar:nth-child(2)
```
```
means "thing that has class
bar
" that is also the 2nd child.