CSS左右布局中间自适应
方法1:左右div设置浮动,脱离标准流,中间那块元素就会上去。 (注意:html代码中中间部分的div必须放到左右div的后面) <style> .boxLeft{ min-height: 100px; width: 200px; background: #987; float: left; } .boxRight{ min-height: 100px; width: 200px; background: #369; float: right; } .boxCenter{ min-height: 100px; margin-left: 220px; margin-right: 220px; background: #192; } </style> <div class="box"> <div class="boxLeft">left</div> <div class="boxRight">right</div> <div class="boxCenter">center</div> </div> 方法2:左右绝对定位的两块div元素,脱离标准流,中间那块元素就会上去 (注意:中间部分的div必须放到左右div的后面) <style> .boxLeft{ min-height: 100px; width: 200px; background: #987; position: