Closed Bug 19686 Opened 26 years ago Closed 26 years ago

{css1} Support for margin: auto

Categories

(Core :: CSS Parsing and Computation, defect, P3)

x86
All
defect

Tracking

()

VERIFIED INVALID

People

(Reporter: supersamat, Assigned: pierre)

Details

(Keywords: css1)

Attachments

(1 file)

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.
Attached file testcase thingy
Status: NEW → RESOLVED
Closed: 26 years ago
Resolution: --- → INVALID
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;".
Status: RESOLVED → VERIFIED
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.
Keywords: css1
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...
See also bug 69927.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: