我设计一个网站,我想我的页眉和页脚的div跨越页面的宽度为100%,并从绝对顶部和页面底部有没有空格开始HTML 100%的宽度页眉和页脚
我目前有这个。
<title>Untitled Document</title>
<style type="text/css">
@import url(http://fonts.googleapis.com/css?family=PT+Sans+Narrow);
#header {
background: #636769;
}
#navigation {
}
body {
font-family: 'PT Sans Narrow', sans-serif;
font-size: 16pt;
background: url(../images/texture.png);
}
#wrapper {
width: 938px;
margin: 0 auto;
padding: 20px 20px;
background: white;
}
#footer {
background: #636769;
}
</style>
</head>
<body>
<!-- begin header -->
<div id="header">
<p>Content</p>
</div>
<!-- begin wrapper -->
<div id="wrapper">
<!-- begin navigation -->
<div id="navigation">
<ol>
<li>link1</li>
<li>link2</li>
<li>link3</li>
<li>link4</li>
</ol>
</div>
<!-- begin content -->
<div id="content">
<h1>Heading</h1>
<p>Content</p>
</div>
</div>
<!-- begin footer -->
<div id="footer">
<p>Content</p>
</div>
</body>
</html>
我希望页眉和页脚看起来像这样; http://rocketbug.com/2.0/
Thankyou,Niall。
在CSS中添加此,随时添加这个CSS来初始化所有元素的HTML所有的CSS, 看看这个例子:http://jsfiddle.net/ARuvu/ – hafid2com