圣杯与双飞翼布局

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>双飞翼圣杯</title>
<style type="text/css">
*{
margin: 0;
padding: 0;
border: 0;
}
.a{
float: left;
}
#wrap{
overflow: hidden;
}
#center{
width: 100%;
height: 500px;
background :#f40;
}
#left{
width: 20%;
height: 500px;
background: green;
margin-left: -100%;
}
#right{
width: 30%;
height: 500px;
background: #ccc;
margin-left: -30%;
}

.header,.footer{
width:100%;
background: #666;
height:30px;
clear:both;
}
.bd{
padding-left:150px;
padding-right:190px;
height: 200px;
}
.left{
background: #E79F6D;
width:150px;
float:left;
margin-left:-100%;
position: relative;
left:-150px;
height: 100%;
}
.main{
background: #D6D6D6;
width:100%;
float:left;
height: 100%;

}
.right{
background: #77BBDD;
width:190px;
float:left;
margin-left:-190px;
position:relative;
right:-190px;
height: 100%;
}

</style>
</head>
<body>
<!-- 双飞翼布局 -->
<div id="wrap">
<div id="center" class="a"></div>
<div id="left" class="a"></div>
<div id="right" class="a"></div>
</div>
<!-- 圣杯布局 -->
<div class="header">Header</div>
<div class="bd">
<div class="main">Main</div>
<div class="left">Left</div>
<div class="right">Right
</div>
</div>
<div class="footer">Footer</div>
</body>
</html>

posted @ 2017-03-06 15:38  张正-博客园  阅读(382)  评论(1编辑  收藏  举报