tags:

views:

63

answers:

2

Hi,

Is it possible to use a fixed width div and an expanding div? Something like:

<div style="float:left; width:200px">
</div>

<div style="float:left; width:100%"> // expand please
</div>

<div style="position:fixed; width:320px">
</div>

I'd like the middle div to just expand in width and take up whatever is left after position the left and right div. It works fine if I give each of them a width in %, but when using a fixed-width for some, they start overlapping when the browser frame gets small etc,

Thanks

A: 

How about:

<html>
  <body>
    <div style="float:left;width:200px;background:red">&nbsp;
    </div>

    <div style="float:right; width:320px;background:blue">&nbsp;
    </div>

    <div style="background:black">&nbsp;
    </div>
  </body>
</html>
Anero
A: 
<div style="left:0;width:30px;"></div>
<div style="left:30px;right:0;"></div>

You may need to make them absolute positioned and the parent relative.

Tor Valamo