两栏布局:
#left {
width: 200px;
background-color: green;
float: left;
}
#content {
background-color: orange;
margin-left: 200px;
}
<div id="left">Left sidebar</div>
<div id="content">Main Content</div>
三栏布局:
1.绝对定位
.left{
position:absolute;
left:0;
width:200px;
}
.right{
position:absolute;
right:0;
width:200px;
}
.maincontent{
margin-left:200px;
margin-right:200px;
}
11
33
22
2.自身浮动法
.left{
float:left;
width:200px;
}
.right{
float:right;
width:200px;
}
11
33
22
阅读(790) | 评论(0) | 转发(0) |