<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>圣杯布局</title>
<style>
*{
padding:0;
margin:0;
}
body{
min-width:700px;
}
.header,.footer{
float:left;
width:100%;
background:#ddd;
height:40px;
line-height:40px;
text-align:center;
}
.container{
padding:0 220px 0 200px;
}
.left,.middle,.right{
position:relative;
float:left;
min-height:300px;
}
.middle{
width:100%;
background:#eee;
}
.left{
width:200px;
background:#666;
margin-left:-100%;
left:-200px;
}
.right{
width:220px;
background:#666;
margin-left:-220px;
right:-220px;
}
</style>
</head>
<body>
<div class="header">
<h4>header</h4>
</div>
<div class="container">
<div class="middle">
<h4>middle</h4>
<p>这是页面的中间内容这是页面的中间内容这是页面的中间内容这是页面的中间内容这是页面的中间内容这是页面的中间内容这是页面的中间内容这是页面的中间内容这是页面的中间内容这是页面的中间内容这是页面的中间内容这是页面的中间内容</p>
</div>
<div class="left">
<h4>left</h4>
<p>左侧内容</p>
</div>
<div class="right">
<h4>right</h4>
<p>右侧内容</p>
</div>
</div>
<div class="footer">
<h4>footer</h4>
</div>
</body>
</html>
慕课网跟练系列——圣杯布局
最新推荐文章于 2020-09-06 14:20:14 发布
