实现双飞翼布局,两边保持不保,只有中间变化:
html代码:
------------------------------------------------------------------------------------
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<style>
*{padding:0;margin: 0;}
.main >div{
float:left;
}
.left{
width:100px;
height:100px;
background: red;
margin-left:-100%;
}
.right{
width:100px;
height:100px;
background: green;
margin-left:-100px;
}
.content{
width: 100%;
height: 100px;
background:blue;
}
.item{
padding-left: 100px;
padding-right: 100px;
}
</style>
</head>
<body>
<div class="main">
<div class="content">
<div class="item">内容</div>
</div>
<div class="left">左</div>
<div class="right">右</div>
</div>
</body>
</html>