The correct fixed-width div should float:right; , then the left div should remain so that it can get the entire available width, but since you want the right div to be fixed, you should put it first.
HTML:
<div id="parentDiv"> <div id="rightFixedDiv"></div> <div id="leftDynamicDiv></div> </div>
CSS
#rightFixedDiv { float:right; border-style:solid; width:100px; height:200px; } #leftDynamicDiv { border-style:solid; background-color:blue; overflow:hidden; height:200px; }
Check this out, fixed width of 100 pixels: http://jsfiddle.net/dkGbd/ fixed width of 200 pixels: http://jsfiddle.net/eESTZ/
Now, if you want the opposite, first place the left div, give it float:left;
Working example: http://jsfiddle.net/UShek/
source share