Closed Bug 253247 Opened 21 years ago Closed 21 years ago

using left:auto or left:0 doesn't consider margin:auto

Categories

(Core :: Layout: Positioned, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: phrostypoison, Unassigned)

Details

Attachments

(2 files)

User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7) Gecko/20040626 Firefox/0.9.1 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040626 Firefox/0.9.1 When using left:auto or left:0 on elements with margin:auto, mozilla/firefox renders incorrectly. See section 10.3.7 of the CSS 2 or 2.1 specification. Reproducible: Always Steps to Reproduce: 1. View a page with the description above. Actual Results: the element is positioned to the left. Expected Results: the element should have been centered and margin:auto regarded, according to section 10.3.7 of the CSS 2/2.1 specification.
Please attach a testcase showing the problem to this bug using <http://bugzilla.mozilla.org/attachment.cgi?bugid=253247&action=enter>. As far as I can tell, this bug worksforme (testcase coming up).
Attached file Testcase
wfm Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8a3) Gecko/20040724
It appears that adding a right:0/auto fixes the problem.
Attached file Original testcase
It appears that mozilla/firefox ignores left:auto.
So.. in your testcase you have left and right both auto (since right is not set and the initial value is auto), width 100px, and margins auto. Let's actually apply the algorithm from section 10.3.7 of the CSS 2.1 specification, shall we? Starting just below the equation we need to satisfy: I) The first paragraph does not apply, since width is not auto II) The second paragraph does not apply, since left and right are auto III) The third paragraph _does_ apply, so both margin-left and margin-right are set to 0. Then we enter the numbered steps: 1) Does not apply 2) Left gets set to the static position (0) and we solve for right. 4-6) Does not apply. The result is that we have zero left/right margins, left is 0, and right is whatever is needed to make the equation work. Marking invalid; our layout of that testcase is exactly correct.
Status: UNCONFIRMED → RESOLVED
Closed: 21 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: