<hr> elements do not honor left and right margins in style




17 years ago
4 years ago


(Reporter: Serge Torres, Unassigned)




Firefox Tracking Flags

(Not tracked)



(4 attachments)



17 years ago
One way to make a centered ruled with a proportional width is to set the left
and right margins in a style attribute.
Ex. (in XHTML) : <hr style="margin-left=40%;margin-right=40%" /> for a 20% with
Mozilla 0.9.5, Redhat 7 rpm build, fails to honor the style whether the margins
are proportional or absolute.
In the proportional case, the rule is offset to the right as much as 200% of the
screen width. The rule itself is about a 100% wide. You have to scroll by a
large amount to see it.
In the absolute case, Mozilla correctly takes into account the left margin but
fails to honor the right margin. The rule seems to have a 100% width so you have
 to scroll to the right by the width of the left margin to see its end.
This behaviour shows up in xhtml and html (loose DTD). I did not test other
documents type.
The margins show up as expected under Netscape 4.78, Amaya 5.1, Internet
Explorer 5 (Windows 2K). Netscpae 6.1 (Windows 2K) exhibit the same behaviour as


Serge Torres
Ecole normale superieure
There's another bug out there somewhere on this. <hr> is a horrible hack in
quirks mode, trying to get consistent behavior out of it is nearly impossible.
Whiteboard: DUPEME
Created attachment 57398 [details]
Strict testcase
WFM in strict and quirks modes on today's Linux CVS. Reporter, do you have a
testcase for this?

Comment 4

17 years ago
Created attachment 57602 [details]
Here is the testcase maile to me by Serge (XHTML doctype)

Removing the DOCTYPE makes this one work...

Comment 5

17 years ago
Confirming issue in the Nov 9th build.
Ever confirmed: true

Comment 6

17 years ago
The problem occur in standards mode only:

See trans_url_doctype_hr.html

Comment 7

17 years ago
Created attachment 57611 [details]
Standards mode enabled with test case


16 years ago
Target Milestone: --- → mozilla1.2

Comment 8

16 years ago
*** Bug 143901 has been marked as a duplicate of this bug. ***

Comment 9

16 years ago
Created attachment 83267 [details]
standards-mode testcase from duplicate bug 143901

Comment 10

16 years ago
having poked around the testcase in the DOM inspector, and played with it a bit,
it looks like the <hr> is having its width computed at [whatever], THEN the
margin is applied, but the margin makes it wider than the containing box, so the
containing box is made wider to fit it in.  

I'm not a layout guru in _any_ nearby universe, but that doesn't sound right.

Comment 11

16 years ago
Please take a look at bug 155523.  It seems that sometime between 11 and 28 June
2002 something happened which causes horizontal rules / lines of, say 100
pixels, to be rendered in the middle / center / centre (searchbait) of the page.
 Here is a distracting test case, where the small horizontal lines should all be
on the left:


This does not involve CSS at all.

- Robin Whittle

Comment 12

16 years ago
*** Bug 158701 has been marked as a duplicate of this bug. ***

Comment 13

15 years ago
-> other@layout.bugs
Assignee: attinasi → other
Keywords: testcase
Target Milestone: mozilla1.2alpha → ---
Fixed by bug 38370.
Last Resolved: 15 years ago
Resolution: --- → FIXED


4 years ago
Whiteboard: DUPEME
You need to log in before you can comment on or make changes to this bug.