Absolutely positioned, non-replaced elements

To quote CSS2:

  "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"

and as part of the solution:

  "2.If both 'height' and 'bottom' are 'auto', replace 'bottom' with 0."

So the element is extended to the bottom of the containing block.

Is there a sound reason for this?

It seems that, where height is 'auto', all other elements go by the
height (intrinsic or otherwise) of the contents.
Why should absolutely positioned elements be different?

A height of 100% (i.e. height of containing block) can always be set
explicitly, if that is so desired.

But currently there is no way to create an absolutely positioned element
which is just large enough for its contents, when the size of the
contents cannot be determined absolutely by the author, but only by the
user agent when the contents are rendered.

Val Sharp - Edinburgh

Received on Wednesday, 9 August 2000 13:18:41 UTC