Re: Why no compositional positioning?

On Mon, Mar 16, 2009 at 10:08 AM, Thomas Davie <tom.davie@gmail.com> wrote:
> Maybe I am indeed missing something that is in css.  I'll give a simple
> example:
>
> <div id="a">
>  <div id="b">
>    <p>This is in div b</p>
>  </div>
> </div>
>
> #a
> {
>  position: absolute;
>  left: 100px;
> }
>
> #b
> {
>  position: parentRelative;
>  left: 10px;
> }

You just want:

#a
{
 position: absolute;
 left: 100px;
}

#b
{
 position: absolute;
 left: 10px;
}

position: absolute is not relative to the document root.  See, e.g.,
the example here:

http://www.w3.org/TR/CSS21/visuren.html#comp-abspos

Received on Monday, 16 March 2009 14:19:18 UTC