Please see the figure below.
I have a div (bounding box) which contains two floated divs inside both of which are floated left. How can I make the second floated div (the red one) extend its width to all the available space inside the bounding box.
Right now, I am doing with javascript but isn’t there a solution for this in CSS?
Edit:
Here is how my HTML is structured
<div id='container'>
<div id='side'>
</div>
<div id='main'>
</div>
</div>
My CSS is more or less like the following
#container {
width: 100%;
position: relative
overflow: hidden;
}
#side {
width: 200px;
}
#main, #side {
float: left;
}
and then I set the #main’s width using jquery
$('#main').width($("#container").width() - $("#sideview-sidebar").width());
Please note I am trying to avoid JS.

Float
#leftSet margin for the
#main, and don’t make it float.If you want to have more flexibility, add another div in
#main, and set its padding/margin.