Closed Bug 167210 Opened 23 years ago Closed 23 years ago

BR element before H2 causes extra spacing

Categories

(Core :: Layout, defect, P3)

x86
All
defect

Tracking

()

RESOLVED INVALID
Future

People

(Reporter: mgalli, Assigned: attinasi)

Details

Attachments

(3 files)

I will add one testcase that demonstrates the problem. The first BR Element that is next to the H2, causes some extra spacing.
Attached file simple testcase.
Testecase table with 4 columns. Col 1 = have two H2 elements next to each other Col 2 = Have one h2, br and another h2 col 3 = have one h2, br, br, h2 col 4 = have one h2, br, br, br, h2 note that the difference of height space between 2-3-4 is one br. however the diff between col 1 and 2 is more than one BR.
Summary: BR element before H2 causes extra spacing → BR element before H2 causes extra spacing
I think this one is INVALID. In the first column, margin collapising occurs, but in the second column there's an element between the headings so margin collapsing does not occur and, threfore, both the margin-bottom of the top heading and the margin-top of the bottom heading are in effect.
Henri, here are some questions/comments back: [1] So what is "margin collapsing" exactly? For this test case, does this term have to do specifically with tables, meaning the margins within the columns or something like that? [2] So how can the HTML be changed to "correct" the behavour? Meaning: How can it be made such that in the first column in the test case, there is no whitespace between the two lines? ( I tried modifying the test case #1 such that the first column has 200 pixels of horizontal width, to see if that's what you mean by margins as far as margins/word wrap within the column, but the white space is still there between the two text lines, even though the text is not hitting the right edge/margin of its cell. ) [3] If "margin collapsing" in this case --is-- specific to tables, then I've attached a second test case that is even more extreme (even more extremely buggy) that shows a non-tables version, with a single BR between two H2 text blurbs, and it seems to show 3 blank H2-sized lines between the two text blurbs/lines (!!!!) even though only on BR in the source code exists between them.
> So what is "margin collapsing" exactly? http://www.w3.org/TR/REC-CSS2/box.html#collapsing-margins > For this test case, does this term have to do specifically with tables, No. > So how can the HTML be changed to "correct" the behavour? Meaning: How > can it be made such that in the first column in the test case, there is > no whitespace between the two lines? h2 { margin-top: 0; margin-bottom: 0; }
QA Contact: petersen → amar
Priority: -- → P3
Target Milestone: --- → Future
Marking INVALID as per comment #2.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: