#wrapper{ background:red; overflow:auto; } #c1{ float:left; background:blue; } #c2{ background:green; float:right; } <div id="wrapper"> <div id="c1">con1</div> <div id="c2">con2</div> </div>