CSS Firefox top-margin Extra Space

Firefox renders CSS margin-top in such a way that if there are two elements, one inside another, and you set margin-top for the inner element, the outer element collapses the margin-top amount of height. So you may see extra ‘padding’ or ‘spacing’ at top of the outer element.

The solution is to add either a padding-top to the child element, or add border-top.

WTF? Does FF just get jealous of all the attention IE gets?


Shi Chuan


Thank you for reading!

It's only fair to share...Tweet about this on Twitter
Share on Facebook
Email this to someone

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.