You can do it as follows:
Suppose you have two divs inside a parent container that expands to fit the page:
<div id="container"> <div id="autowidth">text expands her...</div> <div id="fixed">This is a fixed column</div> </div>
In your CSS:
#container { width:100%; border:1px solid black; padding-right:200px; } #autowidth{ width:100%; background-color:red; float:left; } #fixed{ width:200px; background-color:green; float:right; margin-right:-200px; }
Basically, the parent container holds everything together. It has a 200px registration (width of the right column), so that its contents do not go beyond this point. In turn, the right column has an edge of -200px, so that it forces the boundaries imposed by the parent addition and always puts itself first. The other div, in fact, now only has the spaces provided by the parent container, restrained by its filling, so its 100% will be, in fact, (100% - (parent addition)). You can see the working result of this here: jsfiddle.
I am sure there may be more elegant solutions, so bare with me.
if you want to specify a background, for example, 2 cols, you can go to the classic focal column (see the example list separately )
Damien pirsy
source share