HTML:
<div class="mainDiv">
<div class="left">Left</div>
<div class="center">Center</div>
<div class="right">Right</div>
</div>
.mainDiv{ position: relative;}
.left{ position: absolute; left: 0; top: 0; width: 100px; }
.right{ position: absolute; right: 0; top: 0; width: 100px; }
.center { margin: 0 100px; }
<div style="border:1px solid red; height:140px;">
<div style="width:100px; float:left; border:1px solid blue;">
left
</div>
<div style="width:100px; float:right; border:1px solid blue; ">
right
</div>
<div style="border:5px solid green; overflow:hidden;">
middle
</div>
请查看这个例子