我有两页包含页脚的HTML页面。我想在两页中都将页脚粘贴到页面的底部。当页面没有垂直滚动但内容很多时页面可以正常工作,并且页面具有滚动页脚可以覆盖我的内容。这是我的页面布局:当内容动态化时,将页脚粘贴到页面底部
<body>
<div id="container">
<div id="header"> Header </div>
<div id="menu"> Menu </div>
<div id="content"> Content </div>
<div id="footer"> Footer </div>
</div>
</body>
,这里是我的CSS:
html, body
{
width:100%;
margin:0;
}
#header, #menu, #content, #footer
{
border:thin solid #000;
}
#content
{
width:70%;
margin: 0 auto;
height:100%;
}
#footer
{
position:absolute;
bottom:0;
width:100%;
background-color:#06F;
}
删除'位置:绝对;'在#footer上 –