Blogger Information
Blog 29
fans 0
comment 1
visits 18781
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
css布局之经典三列双飞翼&圣杯布局-2018年3月28日17:33
小小的菜的博客
Original
628 people have browsed it

总结后补

双飞翼布局代码

实例

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>双飞翼布局</title>
	<style type="text/css">
		.box1,.box2 {
			width: 100%;
			height: 50px;
			background-color: #F8F8FF;
		}
		.hd {
			width:800px;
			height: 100%;
			background-color: #D3D3D3;
			margin:auto;
		}
		.box3 {
			width: 800px;
			background-color: yellow;
			margin:auto;
			overflow: hidden;
		}
		.con {
			width:100%;
			float: left;
		}
		.main {
			height: 600px;
			margin:0 100px;
		}
		.left,.right {
			width:100px;
			height: 600px;
			float: left;
		}
		.left {
			margin-left: -100%;
			background-color: red;
		}
		.right {
			margin-left: -100px;
			background-color: red;
		}
		.box2 {
			clear:both;
		}
	</style>
</head>
<body>
	<!-- 头部 -->
	<div class="box1">
		<div class="hd">头部</div>
	</div>
	<!-- 主体 -->
	<div class="box3">
		<div class="con">
			<div class="main">中间</div>
		</div>
		<div class="left">左侧</div>
		<div class="right">右侧</div>
	</div>
	<!-- 底部 -->
	<div class="box2">
		<div class="hd">底部</div>
	</div>
</body>
</html>

运行实例 »

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

圣杯布局代码

实例

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>圣杯布局</title>
	<style type="text/css">
		.box1,.box2 {
			width: 100%;
			height: 50px;
			background-color: #F8F8FF;
		}
		.hd {
			width: 800px;
			height: 100%;
			background-color: #D3D3D3;
			margin: auto;
		}
		.box2 {
			clear:both;
		}
		.box3 {
			width: 600px;
			margin:auto;
			padding: 0 100px;
		}
		.middle {
			width: 100%;
			height: 600px;
			float: left;
			background-color: yellow;
		}
		.left,.right {
			width: 100px;
			height: 600px;
			float: left;
			background-color: red;
			position: relative;
		}
		.left {
			margin-left: -100%;
			left:-100px;
		}
		.right {
			margin-left: -100px;
			right:-100px;
		}
	</style>
</head>
<body>
	<!-- 头部 -->
	<div class="box1">
		<div class="hd">头部</div>
	</div>
	<!-- 主体 -->
	<div class="box3">		
		<div class="middle">中间</div>		
		<div class="left">左侧</div>
		<div class="right">右侧</div>
	</div>
	<!-- 底部 -->
	<div class="box2">
		<div class="hd">底部</div>
	</div>
</body>
</html>

运行实例 »

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

效果图后补

手抄代码

0327作业.jpg

Correction status:qualified

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