<According to the CSS 2.1 spec, a computed value of 'auto' for
'margin-left'<http://www.w3.org/TR/CSS21/box.html#propdef-margin-left> or
'margin-right'<http://www.w3.org/TR/CSS21/box.html#propdef-margin-right>
becomes a used value of '0':
<http://www.w3.org/TR/CSS21/visudet.html#Computing_widths_and_margins>
Yes, for inline-replaced elements that is the case, but my example is covering
a different case. I was using a div with display: block which falls under the
block-level, non-replaced elements section (10.3.3). The description at the
end of that sections states if they're auto their used values are equal,
horizontally centering the element (as you can see is properly done visually).
Visually, it is doing the right thing but not reporting that value back through
the call to getComputedStyle(element, null).getPropertyValue("margin-left").
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/[email protected]/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/[email protected]/
To unsubscribe from this group, send email to
[email protected]