Blogger Information
Blog 87
fans 0
comment 0
visits 59312
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
第九节课作业:3.经典的三列圣杯布局
黄忠倚的博客
Original
521 people have browsed it

实例

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>3.经典的三列圣杯布局</title>
	<style type="text/css">
	.header, .footer {
		width: 100%;/*宽度自适应*/
		height: 60px;
		background-color: lightblue;
	}

	.footer {
		float: both;
	}
	.content {
		width: 1000px;
		min-height: 100%;
		background-color: lightskyblue;
		margin:auto;
		text-align: center;
		line-height: 60px;/*垂直居中*/
		overflow: hidden;
	}
	.contenter {
		width: 600px;
		margin:auto;
		background-color: yellow;
		padding:0 200px;
		overflow: hidden;
	}
	
	.contenter .main {
		width: 100%;
		min-height: 650px;
		float: left;
		background-color: lightyellow;
	}
	.contenter .left {
		width: 200px;
		min-height: 650px;
		float: left;
		margin-left: -100%;
		position: relative;
		left: -200px;
		background-color: pink;
	}
	.contenter .right {
		width: 200px;
		min-height: 650px;
		float: left;
		margin-left: -200px;
		position: relative;
		right: -200px;
		background-color: lightgreen;
	}
	
	</style>
</head>
<body>
	<!-- DOM结构 -->
	<!-- 头部 -->
	<div class="header">
		<div class="content">网站头部</div>
		</div>
		<!-- 内容区 -->
		<div class="contenter">
		<div class="main">中间</div>
		<div class="left">左侧</div>
		<div class="right">右侧</div>
		</div>
		<!-- 底部 -->
		<div class="footer">
			<div class="content">网站底部</div>
		</div>

</body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例


Correction status:Uncorrected

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post