CSS: clean solution to the margin collapse issue when floating an element
Adding overflow: hidden; to the body should solve your problem. It defines a new block formatting context as described in this article: The magic of overflow: hidden. jsFiddle Demo (the body tag is automatically added by jsFiddle, that’s why I haven’t included it in the HTML markup) UPDATE (thx to @clairesuzy): This solution does not … Read more