Closed Bug 91885 Opened 24 years ago Closed 24 years ago

last <br> inside <p> does not include margin specified in CSS

Categories

(Core :: Layout, defect, P4)

x86
Windows 2000
defect

Tracking

()

RESOLVED DUPLICATE of bug 38370
mozilla0.9.4

People

(Reporter: ldubox-coding101, Assigned: dbaron)

Details

Attachments

(1 file)

This problem occurs if <br> is assigned a value for 'margin-top' and/or 'margin- bottom' in a style sheet. When <br> is used within a paragraph (<p>), tt appears to add the margin value to the text before the <br> element. This does not seem logical. I would expect it to add the margin spacing to the text that occurs after the <br> element. Outside <p></p>, the <br> element works as expected. For example; if a paragraph has 3 short lines, with 2 <br> elements separating them, there will be extra space rendered between lines 1 and 2, but not between lines 2 and 3. I will include files to reproduce this.
Hmmm. So should BR be considered a replaced or non-replaced inline element? If the former, then you could argue our behavior is right, although it doesn't make much sense and an alternative would probably be better. If non-replaced, then margins just shouldn't do anything.
Assignee: karnaze → dbaron
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P4
Target Milestone: --- → mozilla0.9.4
Status: NEW → ASSIGNED
David, why shouldn't margins apply for a non-replaced inline element? Section 10.6.1 and 10.6.2 at http://www.w3.org/TR/REC-CSS2/visudet.html#Computing_heights_and_margins seems to specify vertical margins exactly the same.
See 10.8 and 10.8.1. Even if they "apply", they don't do anything since the rules for placing non-replaced inline elements are different. Also see http://www.people.fas.harvard.edu/~dbaron/css/2000/01/dibm and http://www.w3.org/Style/css2-updates/REC-CSS2-19980512-errata.html#x41
br is a non-replaced inline element. See bug 38370. In fact I'm going to mark this as a dup. *** This bug has been marked as a duplicate of 38370 ***
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: