<div class="commentList">
<article class="comment " id="com21"></article>
<article class="comment " id="com20"></article>
<article class="comment " id="com19"></article>
</div>
Any idea why the following last-child selector won’t work for me?
.comment {
width:470px;
border-bottom:1px dotted #f0f0f0;
margin-bottom:10px;
}
.comment:last-child {
border-bottom:none;
margin-bottom:0;
}
So in this case #com19 shouldn’t have a border and a margin at the bottom.
What am I doing wrong here?
thank you
It looks like everything is correct – i have created jsfiddle with last-child
The problem is somewhere else – what is the value of “$border” ? (is it php variable?)
To be sure that your statements will be used, you can add !important