日期:2014-05-16 浏览次数:20529 次
.container{
position:relative;
width:920px;
margin: 0 auto;
overflow:hidden;
}
.cola1,.colb1,.colc1,
.cola2,.colb2,.colc2,
.cola3,.colb3,.colc3{
height:100px;
text-align:center;
line-height: 100px;
color:#FFF;
font-size:24px;
}
.cola1{
float:left;
width: 160px;
background-color: #F00;
}
.colb1{
float:left;
width: 600px;
background-color: #0F0;
}
.colc1{
float:left;
width: 160px;
background-color: #00F;
}
.cola2{
position:absolute;
right:0;
top:0;
width: 160px;
background-color: #F00;
}
.colb2{
width:auto;
margin:0 160px;
background-color: #0F0;
}
.colc2{
position:absolute;
left:0;
top:0;
width: 160px;
background-color: #00F;
}
.cola3{
position:absolute;
left:600px;
top:0;
width: 160px;
background-color: #F00;
}
.colb3{
float:left;
width: 600px;
background-color: #0F0;
}
.colc3{
float:right;
width: 160px;
background-color: #00F;
}
<div class="container">
<div class="cola1">A</div>
<div class="colb1">B</div>
<div class="colc1">C</div>
</div>
<div class="container">
<div class="cola2">A</div>
<div class="colb2">B</div>
<div class="colc2">C</div>
</div>
<div class="container">
<div class="cola3">A</div>
<div class="colb3">B</div>
<div class="colc3">C</div>
</div>