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

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 UTC