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

suggestion: calculating values of sizes

From: |<onrad <karpieszuk@interia.pl>
Date: Wed, 28 Jan 2004 21:15:56 +0100
Message-ID: <4018187C.2080702@interia.pl>
To: www-style@w3.org

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:15:32 GMT

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