/*
* 两端固定,中间自适应!!为圣杯
*/
<style type="text/css"> .site{height:500px;padding:0 50px;} .middle{float:left;width:100%;height:100%;background:#CCC;} .left{float:left;width:50px;height:100%;background:#CCF;margin-left:-100%;position:relative;left:-50px;_left:50px;} .right{float:left;width:50px;height:100%;background:#CFC;margin-left:-50px;position:relative;left:50px;} </style> <div class="site"> <div class="middle"></div> <div class="left"></div> <div class="right"></div> </div>