Alternative for CSS2 Section 10.6.4

The CSS2 Errata 
(http://www.w3.org/Style/css2-updates/REC-CSS2-19980512-errata)
contains proposed changes to the calculation of heights in Section
10.6.4 Absolutely positioned, non-replaced elements.
(http://www.w3.org/TR/REC-CSS2/visudet.html#abs-non-replaced-height)

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.

PROPOSAL:

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
values. 

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

http://members.netscapeonline.co.uk/valeriegsharp/W3Cstyles/index.html

-- 
Regards,
Val Sharp - Edinburgh

Received on Thursday, 15 March 2001 13:45:33 UTC