css布局(一)

 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>CSS布局</title>
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
		<style type = "text/css">
			*
			{
				margin:0;
				padding:0;
			}
			
			body
			{
				margin:10px;
				background:#fff;
			}
			
			
			#header
			{
				border:1px solid black;
				height:60px;
				
				background:#ccc;
				line-height:60px;
				
				margin-bottom:10px;
			}
			
			#header h1
			{
				font-size:16px;
				text-align:center;
				
				height:100%;
				
			}
			
			#nav
			{
				border:1px solid black;
				width:30%;
				height:300px;
				
				float:left;
				/*火狐有用,将区域透明化*/
				/*-moz-opacity:0.2;*/
				margin-bottom:10px;
				
			}
			
			#nav ul
			{
				
				/*第一种方法居中*/
				text-align:center;
				
				/*第二种方法居中*/
				/*width:50px;*/
				/*margin:0 auto;*/
				line-height:150%;

			}
			
			#main
			{
				border:1px solid black;
				width:65%;
				height:300px;
				
				float:right;
				margin-bottom:10px;
			}
			
			#main p
			{
				padding:10px;
				/*首行缩进*/
				text-indent:34px;
				/*每个字之间的间距*/
				letter-spacing:2px;
				line-height:150%;
			}
			
			#footer
			{
				border:1px solid black;
				height:60px;
				line-height:60px;
				/* 清除浮动 */
				clear:both;
				
			}
			
			#footer p
			{
				text-align:center;
				
			}
		</style>
	</head>
	
	<body>
		
		<!-- 流体浮动布局 -->
		<!-- 规格:当视窗发生变化时跟着变化 -->
		<!-- 采用:浮动布局 -->
		<!-- 兼容: 兼容当前主流浏览器 -->
		
		<!-- 流体浮动两列布局 -->
		<div id = "header">
			<h1>这里是标题</h1>
		</div>
		
		<div id = "nav">
			<ul>
				<li>新闻</li>
				<li>杂志</li>
				<li>音乐</li>
				<li>体育</li>
				<li>魔兽</li>
			</ul>
		</div>
		
		<div id = "main">
			<p>Web2.0,是相对Web1.0(2003年以前的互联网模式)的新的一类互联网应用的统称,是一次从核心内容到外部应用的革命。由Web1.0单纯通过网络浏览器浏览html网页模式向内容更丰富、联系性更强、工具性更强的Web2.0互联网模式的发展已经成为互联网新的发展趋势。 </p>
			<p>要理解WEB2.0,先得看WEB的历史。 World Wide Web,简称WWW,是英国人TimBerners-Lee 1989年在欧洲共同体的一个大型科研机构任职时发明的。通过WEB,互联网上的资源,可以在一个网页里比较直观的表示出来;而且资源之间,在网页上可以链来链去。在WEB1.0上做出巨大贡献的公司有Netscape,Yahoo和Google。 Netscape研发出第一个大规模商用的浏览器,Yahoo的杨致远提出了互联网黄页, 而Google后来居上,推出了大受欢迎的搜索服务。 </p>
		</div>
		
		<div id = "footer">
			<p>版权所有 翻版必究</p>
		</div>
		
	</body>
</html>  


 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>CSS布局</title>
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
		<style type = "text/css">
			*
			{
				margin:0;
				padding:0;
			}
			
			body
			{
				margin:10px;
				background:#fff;
			}
			
			
			#header
			{
				border:1px solid black;
				height:60px;
				
				background:#ccc;
				line-height:60px;
				
				
			}
			
			#header h1
			{
				font-size:16px;
				text-align:center;
				
				height:100%;
				
			}
			
			#nav
			{
				border:1px solid black;
				width:20%;
				height:300px;
				
				
				/*火狐有用,将区域透明化*/
				/*-moz-opacity:0.2;*/
				
				float:left;
				
				margin-bottom:10px;
				
			}
			
			#nav ul
			{
				
				/*第一种方法居中*/
				text-align:center;
				
				/*第二种方法居中*/
				/*width:50px;*/
				/*margin:0 auto;*/
				line-height:150%;

			}
			
			#main
			{
				border:1px solid black;
				width:55%;
				height:300px;
				float:left;
				margin-left:2%;
				margin-bottom:10px;
				
			}
			
			#navr
			{
				border:1px solid black;
				width:20%;
				height:300px;
				float:right;
				margin-bottom:10px;
			}
			
			#navr ul
			{
				text-align:center;
			}
			
			#main p
			{
				padding:10px;
				/*首行缩进*/
				text-indent:34px;
				/*每个字之间的间距*/
				letter-spacing:2px;
				line-height:150%;
			}
			
			#footer
			{
				border:1px solid black;
				height:60px;
				line-height:60px;
				/* 清除浮动 */
				clear:both;
				
			}
			
			#footer p
			{
				text-align:center;
				
			}
		</style>
	</head>
	
	<body>
		
		<!-- 流体浮动布局 -->
		<!-- 规格:当视窗发生变化时跟着变化 -->
		<!-- 采用:浮动布局 -->
		<!-- 兼容: 兼容当前主流浏览器 -->
		
		<!-- 流体浮动三列布局 -->
		<div id = "header">
			<h1>这里是标题</h1>
		</div>
		
		<div id = "nav">
			<ul>
				<li>新闻</li>
				<li>杂志</li>
				<li>音乐</li>
				<li>体育</li>
				<li>魔兽</li>
			</ul>
		</div>
		
		<div id = "main">
			<p>Web2.0,是相对Web1.0(2003年以前的互联网模式)的新的一类互联网应用的统称,是一次从核心内容到外部应用的革命。由Web1.0单纯通过网络浏览器浏览html网页模式向内容更丰富、联系性更强、工具性更强的Web2.0互联网模式的发展已经成为互联网新的发展趋势。 </p>
			<p>要理解WEB2.0,先得看WEB的历史。 World Wide Web,简称WWW,是英国人TimBerners-Lee 1989年在欧洲共同体的一个大型科研机构任职时发明的。通过WEB,互联网上的资源,可以在一个网页里比较直观的表示出来;而且资源之间,在网页上可以链来链去。在WEB1.0上做出巨大贡献的公司有Netscape,Yahoo和Google。 Netscape研发出第一个大规模商用的浏览器,Yahoo的杨致远提出了互联网黄页, 而Google后来居上,推出了大受欢迎的搜索服务。 </p>
		</div>
		
		<div id ="navr">
			<ul>
				<li>新闻</li>
				<li>杂志</li>
				<li>音乐</li>
				<li>体育</li>
				<li>魔兽</li>
			</ul>
		</div>
		
		<div id = "footer">
			<p>版权所有 翻版必究</p>
		</div>
		
	</body>
</html>  


 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>CSS布局</title>
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
		<style type = "text/css">
			*
			{
				margin:0;
				padding:0;
			}
			
			body
			{
				margin:10px;
				background:#fff;
			}
			
			
			#header
			{
				border:1px solid black;
				height:60px;
				
				background:#ccc;
				line-height:60px;
				
				
			}
			
			#header h1
			{
				font-size:16px;
				text-align:center;
				
				height:100%;
				
			}
			
			#nav
			{
				border:1px solid black;
				width:20%;
				height:300px;
				
				
				/*火狐有用,将区域透明化*/
				/*-moz-opacity:0.2;*/
				
				float:left;
				
				margin-bottom:10px;
				
			}
			
			#nav ul
			{
				
				/*第一种方法居中*/
				text-align:center;
				
				/*第二种方法居中*/
				/*width:50px;*/
				/*margin:0 auto;*/
				line-height:150%;

			}
			
			#main
			{
				border:1px solid black;
				width:55%;
				height:300px;
				
				margin-left:22%;
				margin-bottom:10px;
				
			}
			
			#navr
			{
				border:1px solid black;
				width:20%;
				height:300px;
				float:right;
				margin-bottom:10px;
			}
			
			#navr ul
			{
				text-align:center;
			}
			
			#main p
			{
				padding:10px;
				/*首行缩进*/
				text-indent:34px;
				/*每个字之间的间距*/
				letter-spacing:2px;
				line-height:150%;
			}
			
			#footer
			{
				border:1px solid black;
				height:60px;
				line-height:60px;
				/* 清除浮动 */
				clear:both;
				
			}
			
			#footer p
			{
				text-align:center;
				
			}
		</style>
	</head>
	
	<body>
		
		<!-- 流体浮动布局 -->
		<!-- 规格:当视窗发生变化时跟着变化 -->
		<!-- 采用:浮动布局 -->
		<!-- 兼容: 兼容当前主流浏览器 -->
		
		<!-- 流体浮动三列布局 -->
		<div id = "header">
			<h1>这里是标题</h1>
		</div>
		
		<div id = "nav">
			<ul>
				<li>新闻</li>
				<li>杂志</li>
				<li>音乐</li>
				<li>体育</li>
				<li>魔兽</li>
			</ul>
		</div>
		
		<div id ="navr">
			<ul>
				<li>新闻</li>
				<li>杂志</li>
				<li>音乐</li>
				<li>体育</li>
				<li>魔兽</li>
			</ul>
		</div>
		
		<div id = "main">
			<p>Web2.0,是相对Web1.0(2003年以前的互联网模式)的新的一类互联网应用的统称,是一次从核心内容到外部应用的革命。由Web1.0单纯通过网络浏览器浏览html网页模式向内容更丰富、联系性更强、工具性更强的Web2.0互联网模式的发展已经成为互联网新的发展趋势。 </p>
			<p>要理解WEB2.0,先得看WEB的历史。 World Wide Web,简称WWW,是英国人TimBerners-Lee 1989年在欧洲共同体的一个大型科研机构任职时发明的。通过WEB,互联网上的资源,可以在一个网页里比较直观的表示出来;而且资源之间,在网页上可以链来链去。</p>
		</div>
		
		<div id = "footer">
			<p>版权所有 翻版必究</p>
		</div>
		
	</body>
</html>  


 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值