W3C home > Mailing lists > Public > www-style@w3.org > March 2001

Alternative for CSS2 Section 10.6.4

From: ValerieGSharp <ValerieGSharp@netscapeonline.co.uk>
Date: Thu, 15 Mar 2001 18:42:04 +0000
Message-ID: <3AB10CFC.CD322ADB@netscapeonline.co.uk>
To: "www-style@w3.org" <www-style@w3.org>
The CSS2 Errata 
contains proposed changes to the calculation of heights in Section
10.6.4 Absolutely positioned, non-replaced elements.

I propose the following alternative for the calculation of such heights.
Bearing in mind that the default value for margins is zero, the aim is
to allow greater use of 'auto' values on margins, especially where it is
desired that 'height' should be based on content.


10.6.4 Absolutely positioned, non-replaced elements

For absolutely positioned elements, the vertical dimensions must satisfy
this constraint: 

'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' +
'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' =
height of containing block

(If the border style is 'none', use '0' as the border width.) The
solution to this constraint is reached through a number of substitutions
in the following order: 

1. If 'height' plus any of 'top', 'bottom', 'margin-top' or
'margin-bottom' are 'auto', then the height is based on the content.

2. If 'top' plus any of 'bottom', 'margin-top' or 'margin-bottom' are
'auto', then treat 'top' like 'static-position'.

3. If 'bottom' is 'auto', then set any other 'auto' values to 0.

4. If both 'margin-top' and 'margin-bottom' are 'auto', solve the
equation under the extra constraint that the two margins get equal

5. If at this point the values are over-constrained, ignore the value
for 'bottom' and solve for that value.

6. If at this point there is only one 'auto' left, solve the equation
for that value. 

A Decision Table comparing results for W3C proposed changes in CSS2
Errata (W3C), and the alternative suggestion (New) can be found at


Val Sharp - Edinburgh
Received on Thursday, 15 March 2001 13:45:33 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:57 UTC