左右两列分别左浮动和右浮动并给一个固定宽度,中间不浮动,也不设定宽度。
<div class="left">1</div>
<div class="right">2</div>
<div class="center">3</div>
<style>
.left{
width: 200px;
background: red;
float: left;
}
.right{
width: 300px;
background: blue;
float: right;
}
.center{
margin:0 300px 0 200px;
background: orange;
}
div{
min-height: 500px;
}
</style>
有
补充:注意<div class="left">1</div> <div class="center">3</div> <div class="right">2</div>
这样写的,因为center为块级元素,会占一行,就算right浮动了,因为center占一行,会被挤到下一层。要注意