W3C home > Mailing lists > Public > www-style@w3.org > August 2000

Re: Absolutely positioned, non-replaced elements

From: Bert Bos <Bert.Bos@sophia.inria.fr>
Date: Wed, 9 Aug 2000 21:53:45 +0200 (MEST)
To: "www-style@w3.org" <www-style@w3.org>
Message-ID: <14737.44477.114691.89604@lanalana.inria.fr>
ValerieGSharp writes:
> 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?

Not really, I'm afraid, just re-use of the same formula...

It looks like this will be changed. We have a new text that will
appear in the draft of the chapter on absolute positioning. It says
that

  - if both 'height' and 'bottom' are 'auto', then the height is
    based on the content (and 'bottom' follows from the equation)

(analogously if 'top' is 'auto' but 'bottom' is not.)

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


Bert
-- 
  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos/                              W3C/INRIA
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France
Received on Wednesday, 9 August 2000 15:53:49 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:05 GMT