Closed Bug 285871 Opened 15 years ago Closed 11 years ago

margin:auto on the root element doesn't work (vertical centering)

Categories

(Core :: Layout: Positioned, defect)

defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: annevk, Unassigned)

References

Details

(Keywords: css2, testcase)

Attachments

(1 file)

358 bytes, application/xml
Details
Testcase coming up showing the problem. If is of any use, Opera does support
this correctly.

(There is a very small chance that this has some relation to bug 243519.)
Attached file testcase
It looks like it centers horizontally without a problem, but fails on the
vertical centering.
Depends on: 243519
To make it more clear. The problem is the vertical centering of the root
element. We support this correctly for non-root elements.
Summary: margin:auto on the root element doesn't work → margin:auto on the root element doesn't work (vertical centering)
Blocks: 286556
Blocks: acid2
No longer blocks: acid2
Bug 286556 has another testcase.  Note that I'm not even sure if it's a bug for
absolute positioning, but it's definitely a bug for fixed positioning.  It's
worth reading the next CSS2.1 draft closely to figure that out.
No longer blocks: 286556
"User agents may treat position as 'static' on the root element."

We take advantage of that, so the testcase doesn't work (the computed value of 'position' in Firefox is 'static'.  Invalid?  (Or do we want to support absolute positioning of the root element?)
The computed value of "position" on the <html> in that testcase is "absolute" over here....
Ah, you're right; oops.  I guess I didn't look carefully enough.
Fixed by checkin for bug 243519.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.