[英]How do I get a sticky footer?
我知道关于粘性页脚有很多问题,但是我似乎无法让它们在我的页面上正常工作。
谁能帮我使我的页脚发粘而不固定?
我的HTML
<div id="container">
<div id="header"></div>
<div id="content"></div>
<div id="footer"></div>
</div>
我的CSS
#container {
width: 980px;
min-height: 100%;
margin-left: auto;
margin-right: auto; }
#content {
width: 100%;
min-height: 100%;
margin: 40px 0; }
#footer {
width: 3000px;
min-height: 185px;
background-color: rgb(0,173,239);
margin-left: -1000px; }
我尝试过各种位置(相对位置,固定位置等),但不起作用。 我似乎固定了页脚并覆盖了内容。 有什么建议么?
试试这个CSS:
body {
min-height: 100%; }
#container {
width: 980px;
min-height: 100%;
margin-left: auto;
margin-right: auto; }
#content {
width: 100%;
min-height: 100%;
margin: 40px 0;
margin-bottom: 290px; }
#footer {
width: 100%;
min-height: 185px;
background-color: rgb(0,173,239);
position: fixed;
bottom: 0;
left: 0;
right: 0; }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.