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

RE: suggestion: calculating values of sizes

From: Scott Romack <sromack@PTSTEAMS.com>
Date: Wed, 28 Jan 2004 14:27:28 -0600
Message-ID: <C902C0F80A54A143AEEAB9893B758DB00B2566@RICHARDSONSRV.PTSTEAMS.COM>
To: <www-style@w3.org>

Yes,
This is badly needed.
It can be done in ie by the way if anyone is interisted.

-----Original Message-----
From: |<onrad [mailto:karpieszuk@interia.pl] 
Sent: Wednesday, January 28, 2004 2:16 PM
To: www-style@w3.org
Subject: suggestion: calculating values of sizes



Hi there!

I just subscribed this mailing list to give You some suggestion (but 
maybe I will stay longer ;) ).

Imagine this layout of <div>s:

+------------------------------------+
|             div id="one"           |
+------------------------------------+
|                                    |
|                                    |
|                                    |
|             div id="two"           | } all divs together has 100%
|                                    |   height
|                                    |
|                                    |
+------------------------------------+
|                                    |
|             div id="three"         |
|                                    |
+------------------------------------+

And we want:

- make #one 100px height
- make #three 200px height
- make #two height like the rest of the screen

The problem is that we do not know which size of browser window somebody

has, we do not how what is rightly height of #two.

I think good solve is something like that (in CSS):

#one {height: 100px;}
#two {height: calc(100% - 300px);}
#three {height: 200px;}

What do you think about adding construction like calc() (or count() - no

metter which name) to the next version of CSS? calc() is calculating 
some values basing on arguments inside parenthesis,

The egzample above is of course only one of adoption of calc()

-- 
pozdrawiam
|<onrad Karpieszuk
www.Karpieszuk.prv.pl
Received on Wednesday, 28 January 2004 15:25:31 GMT

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