Right, so it's weird. This code works as expected:
HTML:
<section> Section #1 </section> <section> Section #2 </section> <section> Section #3 </section>
CSS
section{ margin-right: 30px; } section:last-child{ margin-right: 0; }
The first two sections get the right edge of 30px, and the third section doesn't get the right margin.
Now, if I add a footer item after the last section, the last item will be ignored. Thus, all three sections will have a right edge of 30px. This is true in both Mozilla and Webkit.
Has anyone understood why this is so, and how can it be fixed?
source share