Collapsing Margins Spec - Immediate Child Paragraph in Body Pushing Body Down

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Collapsing Margins Spec - Immediate Child Paragraph in Body Pushing Body Down

By all means, I'm no expert on collapsing margins since I just learned about them today, but does the spec really make sense that a paragraph should affect the margin of the body and push it down?

I've been using HTML for years, but today is the first time I've run into this issue (most likely because I don't normally start with just a simple paragraph after the body).  Thinking I had discovered a bug in Firefox, I filed this bug here:

I would think that the body should not be affected by child margins... nothing should be able to render outside of the body (margins included).

Otherwise, it becomes difficult to add a paragraph (with its default styling) to the body that doesn't affect its margin?

Am I making any sense?  Please read the bug for more information.  The html sample I'm talking about is the following:

<!DOCTYPE html>
<style type="text/css">
body{margin: 0px; background-color: black; color: white;}
html{background-color: pink;}
html, body{height: 100%;}
<p style="overflow: hidden;">This paragraph pushes body down because of preceeding empty hidden div... wtf?</div>

I would imagine the specs should not allow the body to be affected by the child paragraph's margins.  In my example posted above and in the bug report, I don't want to see the HTML's pink color. The body shouldn't have been pushed down.  Thoughts on this?  Is there a link somewhere to the official spec covering this very scenario? 

I'm confused.