How about rethinking the design, and hiding the supported :first-child
pseudo...and clearing up the div-itus?
.comment { border-top:1px solid red }
.comment:first-child { border:none; }
<div id="question_comments" class="comments_container">
<div class="comment">
<p>Comment1</p>
</div>
<div class="comment">
<p>Comment2</p>
</div>
</div>
I realize you may just be using hr...
as a dumby class, but I took the liberty of using it as a <hr>
element (which, btw is better than a <div>
that acts/works the same)
http://jsfiddle.net/pVcrV/
*EDIT: (to put back a container) *
<div id="question_comments" class="comments_container">
<hr>
<div class="comment">
<p>Comment1</p>
</div>
<hr>
<div class="comment">
...
</div>
http://jsfiddle.net/VJVxt/
I'm sort of assuming that you're pulling these comments from a database, and having a server-side language spit out the HTML on the fly. Starting that dump with the divider (then using :first-child
to hide it) isn't 100% semantic; HOWEVER, one element vs a JavaScript, or a CSS hack seems more than a fair trade-off.