我有一个可正常运行的页脚,但是当页面内容的大小比页面大小短时,页脚会呈现在内容不在底部的内容之下页面,这里是图像:内容短于页面大小时出现粘滞页脚
这里是我的代码(jsbin段):
.footer {
position: absolute;
width: 100%;
margin-bottom: 0;
background-color: #2D2D2D;
height: 100px;
text-align: center;
color: white;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<meta name="viewport" content="width=device-width" />
</head>
<body ng-app="AngularJSApp">
<div class="contentBody">
<div id="contenido">
@RenderBody()
</div>
</div>
<div class="footer">
<p class="copyright">Copyright © 2015 Diego Unanue — <a href="http://ryanfait.com/" title="3xM Web Design">3xM Web Design</a></p>
</div>
</body>
</html>
我能做些什么来解决这个问题,并始终将页脚保留在页面的底部?
'的位置是:固定;底部:0' –
@gp。你怎么知道什么时候修复而不是?我相信他不希望整个时间都固定页脚。 – evolutionxbox
它会更好,如果你可以提供我们你的代码在jsFiddle .. –