Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

2.1.49 [CSS-Level2-2009] Section 10.6.4, Absolutely positioned, non-replaced elements

V0086:

The specification states:

If all three of 'top', 'height', and 'bottom' are auto, set 'top' to the static 
position and apply rule number three below.
If none of the three are 'auto': If both 'margin-top' and 'margin-bottom' are 
'auto', solve the equation under the extra constraint that the two margins get 
equal values. If one of 'margin-top' or 'margin-bottom' is 'auto', solve the 
equation for that value. If the values are over-constrained, ignore the value for 
'bottom' and solve for that value.
Otherwise, pick the one of the following six rules that applies.

1.'top' and 'height' are 'auto' and 'bottom' is not 'auto', then the height is 
based on the content, set 'auto' values for 'margin-top' and 'margin-bottom' to 0, 
and solve for 'top' 
2. 'top' and 'bottom' are 'auto' and 'height' is not 'auto', then set 'top' to the 
static position, set 'auto' values for 'margin-top' and 'margin-bottom' to 0, and 
solve for 'bottom'
3. 'height' and 'bottom' are 'auto' and 'top' is not 'auto', then the height is 
based on the content, set 'auto' values for 'margin-top' and 'margin-bottom' to 0, 
and solve for 'bottom'
4. 'top' is 'auto', 'height' and 'bottom' are not 'auto', then set 'auto' values 
for 'margin-top' and 'margin-bottom' to 0, and solve for 'top'
5. 'height' is 'auto', 'top' and 'bottom' are not 'auto', then 'auto' values for 
'margin-top' and 'margin-bottom' are set to 0 and solve for 'height'
6. 'bottom' is 'auto', 'top' and 'height' are not 'auto', then set 'auto' values 
for 'margin-top' and 'margin-bottom' to 0 and solve for 'bottom'.

Quirks Mode and IE7 Mode (All Versions)

If none of the three properties (top, height, and bottom) are set to auto and if both margin-top and margin-bottom are auto, then margin-top is set to 0 and the equation is solved for margin-bottom.

Quirks Mode (All Versions)

The following variations occur in this mode:

  • If none of the three properties (top, height, and bottom) are set to auto and when margin-top is auto and margin-bottom is not, margin-top is set to 0 and the equation is solved for margin-bottom.

  • Rule 5: When Height is auto and top and bottom are not auto, then the auto values for margin-top and margin-bottom are set to 0, height is set to minimum height (the current line height) and the equation is solved for bottom.

Show:
© 2015 Microsoft