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

Width: the trouble of a fixed width div and a relative width

From: Rik <coolcat_the_best@hotmail.com>
Date: Mon, 16 Apr 2012 22:20:01 +0200
Message-ID: <SNT132-ds13BE1063D86FFE9BCCE5B2CF3E0@phx.gbl>
To: <www-style@w3.org>
I ran into this problem multiple times. I want to have a two divs. One on the left side with a fixed width (like 150 px) and one on the right side with a variable width, like (a percentage of) the remaining width. I know there are work arounds for this problem, but it’s never a really easy solution (the best one I could find is the Holy grail by Matthew Levine). It would be much easier if I could use something like this:

..left {
    width : 150px;
}
..right {
    width : fill;    (or width : remainder;)
}

it could be even extended by including a percentage like this:

..left {
    width : 150px;
}
..right {
    width : fill 80%;    (or width: remainder 80%;)
}

I think I wouldn’t be the only one who would like this change to the width tag, since a lot of web pages have a site navigation bar at the left side with a fixed width. 
With this modification, one of the problems of different screenresolutions will be solved by only one line of CSS code(in stead of 278 lines I’m using now, a class I created for this in php).

Does this idea have any chance of being implemented in the CSS recommendations?

- Rik
Received on Wednesday, 18 April 2012 12:04:02 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:52 GMT