Collapsing Margins Spec - Immediate Child Paragraph in Body Pushing Body Down
OwN-3m-All <[email protected]> Thu, 12 Nov 2015 21:03:27 -0700
| Newsgroups | gmane.comp.web.html.general |
|---|---|
| Message-ID | <CAK0ZC5W3=rRXA+O270LpzNik8-JbzfukUQp5rJcoPA0xoeV0vw@mail.gmail.com> |
--001a11444f24483b5105246424bb
Content-Type: text/plain; charset=UTF-8
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:
https://bugzilla.mozilla.org/show_bug.cgi?id=1224292
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>
<html>
<head>
<style type="text/css">
body{margin: 0px; background-color: black; color: white;}
html{background-color: pink;}
html, body{height: 100%;}
</style>
</head>
<body>
<p style="overflow: hidden;">This paragraph pushes body down because of
preceeding empty hidden div... wtf?</div>
</body>
</html>
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.
--001a11444f24483b5105246424bb
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div><div><div><div><div>By all means, I'm no expert o=
n collapsing margins since I just learned about them today, but does the sp=
ec really make sense that a paragraph should affect the margin of the body =
and push it down?<br><br></div>I've been using HTML for years, but toda=
y 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).=C2=A0 T=
hinking I had discovered a bug in Firefox, I filed this bug here:<br><br><a=
href=3D"https://bugzilla.mozilla.org/show_bug.cgi?id=3D1224292">https://bu=
gzilla.mozilla.org/show_bug.cgi?id=3D1224292</a><br><br></div>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).<br><br></div>Otherw=
ise, it becomes difficult to add a paragraph (with its default styling) to =
the body that doesn't affect its margin?<br><br></div>Am I making any s=
ense?=C2=A0 Please read the bug for more information.=C2=A0 The html sample=
I'm talking about is the following:<br><br><!DOCTYPE html> <br>&=
lt;html><br><head><br><style type=3D"text/css"><br=
>body{margin: 0px; background-color: black; color: white;}<br>html{backgrou=
nd-color: pink;}<br>html, body{height: 100%;}<br></style><br></hea=
d><br><body><br><p style=3D"overflow: hidden;">Thi=
s paragraph pushes body down because of preceeding empty hidden div... wtf?=
</div><br></body><br></html><br><br></div><div>I would im=
agine the specs should not allow the body to be affected by the child parag=
raph's margins.=C2=A0 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.=C2=A0 Thoughts on this?=C2=A0 Is there a link somewh=
ere to the official spec covering this very scenario?=C2=A0 <br><br></div><=
div>I'm confused.<br></div></div>
--001a11444f24483b5105246424bb--