码迷,mamicode.com
首页 > Web开发 > 详细

HTML——左右側边栏布局

时间:2016-02-13 15:45:09      阅读:158      评论:0      收藏:0      [点我收藏+]

标签:



<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>上中下布局</title>
		<style type="text/css">
			body{
				background: #42413C ;
				margin: 0;/*消除body中的留白*/
				padding: 0;
				text-align: center;
			}
			
			.container{
				width: 778px;
				background: #FFF;
				margin: 0 auto;/*側边的自己主动值与宽度结合使用,能够将布局居中对齐*/
				text-align: left;
			}
			
			.header{
				padding: 10px 0;
				background: #ADB96E;
			}
			
			.content{
				padding: 10px 0;
			}
			
			.footer{
				padding: 0px;
				background: #CCC49F;
			}
		</style>
	</head>
	<body>
		<div class="container">
			<div class="header">
				<h1>网页头部</h1>
			</div>
			<div class="content">
				<h1>网页正文</h1>
				<h1>网页正文</h1>
				<h1>网页正文</h1>
				<h1>网页正文</h1>
				<h1>网页正文</h1>
			</div>
			<div class="footer">
				<h1>脚注</h1>
			</div>
		</div>
	</body>
</html>


HTML——左右側边栏布局

标签:

原文地址:http://www.cnblogs.com/mengfanrong/p/5187653.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!