【发布时间】:2013-04-19 06:04:44
【问题描述】:
我知道这个问题已经被问过很多次了,但我还没有找到真正适合我的解决方案。
我的html...
<body>
<div id="container">
</div>
<div id="footer">
</div>
</body>
我的 CSS....
body, html { min-height:100%;}
#container
width: 980px;
min-height: 100%;
margin: 0 auto;}
footer {
background-color: rgb(90,200,219);
height: 50px;
position: realative;
margin-top: -50px;
width: 100%; }
发生了什么,页脚完全粘在页面底部。但是,当内容很短时,我仍然需要向下滚动才能找到粘在底部的页脚。有人能告诉我我的代码有什么问题吗?
【问题讨论】:
-
有几个错别字;
#footer和position: relative;. -
啊,是的。那是我把它放在这里不同。我的实际代码没有错别字
标签: html css sticky-footer