Re: [CSS2.1] 'clear' and the static position of an absolutely positioned element

On Monday 09 June 2008 16:24, fantasai wrote:
> Mats Palmgren wrote:
> > CSS 2.1, 10.6.4 says:
> > [...] the static position for 'top' is the distance from the top
> > edge of the containing block to the top margin edge of a
> > hypothetical box that would have been the first box of the element
> > if its 'position' property had been 'static' and 'float' had been
> > 'none'.
> >
> > I suggest we add /and 'clear' had been 'none'/ to that.
> >
> > The suggested addition matches what most UAs do, with the exception
> > of IE7, but IE8 beta 1 seems to match other UAs now.  See [1] for
> > test details.
> >
> > Thanks,
> > Mats Palmgren
> >
> > [1]
> > https://bugzilla.mozilla.org/show_bug.cgi?id=390516
>
> Recorded as CSS2.1 Issue 42
>    http://csswg.inkedblade.net/spec/css2.1#issue-42

Not sure that's a good change, but not sure I mind either.

The reason you use the static position ('position: absolute; top: auto') 
is to overlap with with whatever comes next, e.g.:

    ... Assume some floating box here...
    <p style="position: absolute; top: auto">
      Some text to be shown behind the next text...
    <p>
      Some text that is supposed to be shown in front of the previous
      text

If I add 'clear: left' to the second P, the first P will not be behind 
the second P anymore. I might try adding 'clear: left' to the first P, 
too...



Bert
-- 
  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos                               W3C/ERCIM
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France

Received on Wednesday, 30 July 2008 15:41:18 UTC