[ 响应式设计 ] 响应式设计入门!

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>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<meta name="viewport" content="initial-scale=1.0,width=device-width" />
	<title>And the winner isn't</title>
	<link href="css/main-pecent.css" rel="stylesheet" type="text/css" />
</head>
<body>
	<div id="wrapper">
		<!-- the header and navigation -->
		<div id="header">
			<div id="navigation">
				<ul>
					<li><a href="#"><img src="images/01.jpg" alt="image"/></a></li>
					<li><a href="#">navigation2</a></li>
					<li><a href="#">navigation3</a></li>
					<li><a href="#">navigation4</a></li>
					<li><a href="#">navigation5</a></li>
					<li><a href="#">navigation6</a></li>
					<li><a href="#">navigation7</a></li>
					<li><a href="#">navigation8</a></li>
					<li><a href="#">navigation9</a></li>
				</ul>
			</div>
		</div>
		<!-- the content -->
		<div id="content">
			<p><img src="images/01.jpg" alt="imgage"/></p>
		</div>
		<!-- the sidebar -->
		<div id="sidebar">
			<p><img src="images/01.jpg" alt="imgage"/>dfdfdf</p>
		</div>
		<!-- the footer -->
		<div id="footer">
			<p>Here is the footer</p>
		</div>
	</div>
</body>
</html>

css:

#wrapper {
	margin-right: auto;
	margin-left: auto;
	width: 96%; /* 最外层 DIV */
}
#header {
	margin-right: 10px;
	margin-left: 10px;
	width: 97.9166667%; /* 940 ÷ 960 */
}

#navigation {
	padding-bottom: 25px;
	margin-top: 26px;
	margin-left: -1.0416667%; /* 10 ÷ 960 */
	padding-right: 1.0416667%; /* 10 ÷ 960 */
	padding-left: 1.0416667%; /* 10 ÷ 960 */
	width: 97.9166667%; /* 940 ÷ 960 */
	background-repeat: repeat-x;
	background-image: url(../img/atwiNavBg.png);
	border-bottom-color: #bfbfbf;
	border-bottom-style: double; border-bottom-width: 4px;
}
#navigation ul li {
	display: inline-block;
	margin-right: 2.6595745%; /* 25 ÷ 940 */
}

#navigation ul li a {
	height: 42px;
	line-height: 42px;
	text-decoration: none;
	text-transform: uppercase;
	font-family: Arial, "Lucida Grande", Verdana, sans-serif;
	font-size: 1.6875em;
	color: black;
}
img{
	width: 10%;
}
#navigation ul li a img{
	
}

#content {
	margin-top: 58px;
	margin-right: 1.43266475%;
	float: right;
	width: 72.7083333%; /* 698 ÷ 960 */
}
#sidebar {
	border-right-color: #e8e8e8;
	border-right-style: solid;
	border-right-width: 2px;
	margin-top: 58px;
	margin-right: 0.458715596%;
	margin-left: 0.458715596%;
	float: left;
	width: 22.7083333%; /* 218 ÷ 960 */
}
#footer {
	float: left;
	margin-top: 20px;
	margin-right: 10px;
	margin-left: 10px;
	clear: both;
	width: 97.9166667%; /* 940 ÷ 960 */
}


  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值