W3C home > Mailing lists > Public > www-style@w3.org > April 1997

Re: CSS positioning and window dimensions

From: Robert Stevahn <rstevahn@boi.hp.com>
Date: Wed, 16 Apr 1997 15:27:48 -0700
Message-Id: <9704162134.AA10843@hpbs972.boi.hp.com>
To: "David Perrell" <davidp@earthlink.net>
Cc: www-style@w3.org
"David Perrell" <davidp@earthlink.net> asks about the following:

> With this declaration:
> 
>    BODY { overflow: clip; }

The 'overflow:' property here should be ignored, because it only
applies to positionable elements. Since the default value of the
'position:' property is 'static', 'overflow' does not apply. Not
that it makes a difference in this example.

>    DIV  { top: 0; left: 0; width: 100%; height: 100%;
>           overflow: scroll; }
> 
> and this markup:
> 
>    <BODY>
>    <DIV>
>    <P>Does this division element fill the UA window?
>    </DIV>
> 
> what happens?

I'm afraid the behavior is undefined, because the <BODY> element has
a 'height:' of 'auto'. The draft says, "specifying a percentage
value for 'height' if the parent element's height is set to 'auto'
has undefined behavior."

> If the default initial position and size of BODY could be considered
> congruent with the UA's window, CSS positioning would provide an
> alternative to frames for non-scrolling navigation bars.

Based on my interpretation of the draft, of which I am the editor but
not an implementer, this doesn't work. We've had requests for the
ability to position elements relative to the document window, and
this may be considered in the future. For now, I'm afraid you're
stuck with frames.

You _could_ set the size of the <BODY> element to an arbitrary size,
and nest positioned elements (like <DIV>s) within it, using
percentages. The only thing missing is knowledge of the document
window size, although you may be able to determine this in some
scripting environments.

Regards,
--
Robert Stevahn -- mailto:rstevahn@boi.hp.com
+1 208 396 4787 -- HP Business LaserJet Division
Personal: mailto:rstevahn@pobox.com
Received on Wednesday, 16 April 1997 17:30:08 GMT

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