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

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

From: Barry van Oudtshoorn <bvanoudtshoorn@gmail.com>
Date: Wed, 18 Apr 2012 20:13:55 +0800
Message-ID: <CAFsVuTMT8eWkGWxXmMdK-71ma9VQvBxVdnHFsKrzbnYLFwj96w@mail.gmail.com>
Cc: "www-style@w3.org" <www-style@w3.org>
On Tuesday, April 17, 2012, Rik wrote:

>   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%;)
> }
>

Couldn't you just use calc()? For example:

.left {
  width: 150px;
}
.right {
  width: calc(80% - 150px);
  /* or calc(100% - 150px); */
}

Barry van Oudtshoorn
barryvan.com.au


-- 
Barry van Oudtshoorn
http://barryvan.com.au/
bvanoudtshoorn@gmail.com
Received on Wednesday, 18 April 2012 12:14:31 GMT

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