Closed
Bug 19686
Opened 26 years ago
Closed 26 years ago
{css1} Support for margin: auto
Categories
(Core :: CSS Parsing and Computation, defect, P3)
Tracking
()
VERIFIED
INVALID
People
(Reporter: supersamat, Assigned: pierre)
Details
(Keywords: css1)
Attachments
(1 file)
383 bytes,
text/html
|
Details |
As said in the WC3 CSS1 spec (in an obscure location):
Otherwise, if both 'margin-left' and 'margin-right' are 'auto', they will be set
to equal values. This will center the element inside its parent.
Mozilla currently does not seem to support this or do anything when margin: auto
or margin-left/right: auto is applied. I think this would be a helpful and EASY
way to center elements, and thus should be implemented.
I will supply a testcase if one is needed. I tested this with a pre-M11 nightly.
Reporter | ||
Comment 1•26 years ago
|
||
Assignee | ||
Updated•26 years ago
|
Status: NEW → RESOLVED
Closed: 26 years ago
Resolution: --- → INVALID
Assignee | ||
Comment 2•26 years ago
|
||
From Cascading Style Sheets 2nd Edition page 220 (it's somewhere in the official
CSS spec too):
---
Setting left and right to auto doesn't center an absolutely positioned element,
like setting margin-left and margin-right to auto would do for a normal (static)
block. But there are various other ways to center an absolutely positioned block
in its containing clock. For example, you can [snip] set left and right to 0 and
use the margins to center the element.
---
It means that your code is invalid (at least for what you want do). To fix it,
either remove "position: absolute;" or add "left: 0; right: 0;".
Updated•26 years ago
|
Status: RESOLVED → VERIFIED
Comment 3•26 years ago
|
||
Looks like 5.0 is positioning the div correctly. The div gets resolved to the
left edge of the body. Read section 10.3.7 of CSS2 specs for more info.
Verifying bug invalid.
Comment 4•26 years ago
|
||
Migrating from {css1} to css1 keyword. The {css1}, {css2}, {css3} and {css-moz}
radars should now be considered deprecated in favour of keywords.
I am *really* sorry about the spam...
You need to log in
before you can comment on or make changes to this bug.
Description
•