22.12.2013 Views

W3C CSS2 Cascading Style Sheets, level 2 - instructional media + ...

W3C CSS2 Cascading Style Sheets, level 2 - instructional media + ...

W3C CSS2 Cascading Style Sheets, level 2 - instructional media + ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

(If the border style is ’none’, use ’0’ as the border width.) If all of the above<br />

have a specified value other than ’auto’, the values are said to be<br />

"over-constrained" and one of the computed values will have to be different from<br />

its specified value. If the ’direction’ property has the value ’ltr’, the specified value<br />

of ’margin-right’ is ignored and the value is computed so as to make the equality<br />

true. If the value of ’direction’ is ’ltr’, this happens to ’margin-left’ instead.<br />

If there is exactly one value specified as ’auto’, its computed value follows from<br />

the equality.<br />

If ’width’ is set to ’auto’, any other ’auto’ values become ’0’ and ’width’ follows<br />

from the resulting equality.<br />

If both ’margin-left’ and ’margin-right’ are ’auto’, their computed values are<br />

equal.<br />

10.3.4 Block-<strong>level</strong>, replaced elements in normal flow<br />

If ’left’ or ’right’ are ’auto’, their computed value is 0. If ’width’ is specified as<br />

’auto’, its value is the element’s intrinsic [p. 30] width. If one of the margins is<br />

’auto’, its computed value is given by the constraints [p. 134] above. Furthermore,<br />

if both margins are ’auto’, their computed values are equal.<br />

10.3.5 Floating, non-replaced elements<br />

If ’left’, ’right’, ’width’, ’margin-left’, or ’margin-right’ are specified as ’auto’, their<br />

computed value is ’0’.<br />

10.3.6 Floating, replaced elements<br />

If ’left’, ’right’, ’margin-left’ or ’margin-right’ are specified as ’auto’, their computed<br />

value is ’0’. If ’width’ is ’auto’, its value is the element’s intrinsic [p. 30] width.<br />

10.3.7 Absolutely positioned, non-replaced elements<br />

The constraint that determines the computed values for these elements is:<br />

’left’ + ’margin-left’ + ’border-left-width’ + ’padding-left’ + ’width’ +<br />

’padding-right’ + ’border-right-width’ + ’margin-right’ + ’right’ = width of<br />

containing block [p. 131]<br />

(If the border style is ’none’, use ’0’ as the border width.) The solution to this<br />

constraint is reached through a number of substitutions in the following order:<br />

1. If ’left’ has the value ’auto’ while ’direction’ is ’ltr’, replace ’auto’ with the<br />

distance from the left edge of the containing block to the left margin edge of<br />

a hypothetical box that would have been the first box of the element if its<br />

’position’ property had been ’static’. (But rather than actually computing that<br />

box, user agents are free to make a guess at its probable position.) The<br />

value is negative if the hypothetical box is to the left of the containing block.<br />

2. If ’right’ has the value ’auto’ while ’direction’ is ’rtl’, replace ’auto’ with the<br />

distance from the right edge of the containing block to the right margin edge<br />

of the same hypothetical box as above. The value is positive if the hypothetical<br />

box is to the left of the containing block’s edge.<br />

135

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!