W3C home > Mailing lists > Public > www-style@w3.org > March 2004

Re: width and height

From: Lachlan Hunt <lachlan.hunt@iinet.net.au>
Date: Fri, 19 Mar 2004 10:01:34 +1100
Message-ID: <405A2A4E.2080901@iinet.net.au>
To: Rastislav Graus <rastislav.graus@arsnova.sk>
Cc: "www-style@w3.org" <www-style@w3.org>

Rastislav Graus wrote:

> Layout fills 100% of width and 100% of height his content-box:
> +------------------------------------------------+
> | width: 100%; height: 100px;                    |
> +----------------+-------------------------------+
> | width: 300px;  | width: rest;                  |
> | height: rest;  | height: rest;                 |
> |                |                               |
> |                |                               |
> |                |           CONTENT             |
> |                |                               |
> |                |                               |
> |                |                               |
> +----------------+-------------------------------+
> 
> I sugesst to define new value "rest" for atributes width and height with 
> the meaning, that the box of element fills all the remaining space of 
> the content-box.

   This is not necessary because other CSS properties can give a similar 
result.  For example,

#content {
     position: absolute;
     top: 100px; left: 300px;
     bottom: 0; right: 0;
     height: auto; width: auto;
     overflow: scroll;
}

   Although, just like most standards compliant CSS, this doesn't work 
properly in Internet Explorer because IE can't handle setting 'top' and 
'bottom' together, or 'left' and 'right' together.  There may be many 
other methods to acheive a similar result; look up some CSS tutorials, 
many of which also cover hacks for the non-standard browsers.

-- 
Lachlan Hunt
Received on Thursday, 18 March 2004 18:01:54 GMT

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