Previous Message
Next Message

position:absolute - to the document or the viewport?

Sent by David Dorward on 14 March 2006 13:01


On 14/03/06, Alisha [EMAIL-REMOVED]> wrote:
> #extra1 {
>     position: absolute;
>     bottom:0;
>     right:0;
> }
>
> well.. if I do something like this I can't get the effect I was kinda
> sure "position:absolute" was especially made to obtain.
> the #extra1 stays at the bottom, but the bottom of the viewport.

Absolute positioning is done with respect to the edges of the
"containing block". This is the first ancestor element which is
"positioned". "Positioned" means "Has a value for the position
property other than "static".

If there is no containing block then positioning is with respect to
the region bounded by the viewport when the browser is scrolled to the
top.

The solution is to set the position property to something other than
static (relative is the usual choice) on the body. (I don't do this
often, but I have a feeling that MSIE objects to it).

--
David Dorward <http://dorward.me.uk><http://blog.dorward.me.uk>
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread: