摘要:<!DOCTYPE html><html><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta http-equiv=&
<!DOCTYPE html>
<html>
<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>
body {
margin: 0;
}
/* 顶部导航样式 */
.header {
width: 100%;
height: 60px;
background-color: #000;
}
.header .content {
width: 1200px;
height: 60px;
background-color: #000;
margin: 0 auto;
}
.header .content .nav {
margin: 0;
padding: 0;
}
.header .content .nav .item {
list-style-type: none;
}
.header .content .nav .item a {
float: left;
width: 130px;
height: 54px;
line-height: 60px;
text-decoration: none;
color: #fff;
padding: 0 10px;
font-size: 16px;
text-align: center;
}
.header .content .nav .item a:hover {
color: #fff;
border-bottom: 6px solid lightgreen;
}
/* 中间部分样式 */
.container {
width: 600px;
min-height: 600px;
margin: 10px auto;
background-color: #ccc;
padding-left: 300px;
padding-right: 300px;
}
.main {
float: left;
width: inherit;
min-height: 600px;
background-color: lightcoral;
}
.left {
float: left;
width: 300px;
min-height: 600px;
background-color: lightblue;
margin-left: -100%;
position: relative;
left: -300px;
}
.right {
float: left;
width: 300px;
min-height: 600px;
background-color: lightgreen;
margin-left: -300px;
position: relative;
left: 300px;
}
/* 底部版权样式 */
.footer {
width: 100%;
height: 100px;
background-color: #000;
}
.footer .content {
width: 1200px;
height: 100px;
margin: 0 auto;
background-color: #000;
line-height: 100px;
}
.footer .content .p1 {
margin: 0;
padding-top: 24px;
height: 20px;
text-align: center;
line-height: 20px;
color: #fff;
font-size: 14px;
}
.footer .content .p2 {
margin: 0;
padding-top: 10px;
height: 20px;
text-align: center;
line-height: 20px;
color: #fff;
font-size: 14px;
}
</style>
</head>
<body>
<!-- 顶部导航 -->
<div class="header">
<div class="content">
<ul class="nav">
<li class="item"><a href="http://">网站首页</a></li>
<li class="item"><a href="http://">视频教程</a></li>
<li class="item"><a href="http://">社区问答</a></li>
<li class="item"><a href="http://">编程词典</a></li>
<li class="item"><a href="http://">手册下载</a></li>
<li class="item"><a href="http://">工具下载</a></li>
<li class="item"><a href="http://">类库下载</a></li>
<li class="item"><a href="http://">特色课程</a></li>
</ul>
</div>
</div>
<!-- 中间部分 -->
<div class="container">
<div class="main">主体内容区</div>
<div class="left">左边</div>
<div class="right">右边</div>
</div>
<!-- 底部版权 -->
<div class="footer">
<div class="content">
<p class="p1">PHP中文网:独家原创,永久免费的在线php视频教程,php技术学习阵地!</p>
<p class="p2">Copyright 2014-2018 http://www.php.cn All Rights Reserved | 皖B2-20150071-9<p>
</div>
</div>
</body>
</html>
批改老师:天蓬老师批改时间:2019-01-22 09:15:06
老师总结:你这个案例,很有意思, 用一个布局将常用标签都用到, 思路不错