I am having trouble getting :last-child
to work in my situation.
HTML:
<div class="test">Some content</div>
<div class="test">Some content</div>
<div class="test">Some content</div>
<div class="action">Some other content</div>
CSS:
div.topic {
border-bottom: 1px solid black;
}
div.topic:last-child {
border-bottom: none;
}
The last div.test
still has the border at the bottom.
The problem I think is that the border-bottom: none
applies to the very last div which is div.action
and not to the last div of class test.
How can I solve it?