body {
background: #ffffff;
color: #000;
font-family: Verdana, Arial, Sans-Serif;
font-size: 13px;
text-align: center; /* IE 5 fix */
line-height: 1.4;
height: 100%;
margin: 0;
padding: 0;
}
#container {
width: 50%;
background: #fff;
border: none;
color: #000000;
margin: auto auto;
padding: 20px;
text-align: left; /* IE 5 fix */
overflow:auto;
padding-bottom: 180px
}
#wrap {
min-height: 100%;
}
#footer {
background: #000 url(images/cbf/foot.png) repeat;
border-top: solid 1px #000;
position: relative;
width:100%;
margin-top: -180px; /* negative value of footer height */
height: 180px;
clear:both;
}
忙了一整天,也许我的眼睛只是累得瞎了。
我也在 body 标签内合并了 wrap div,我清除了缓存并尝试了 Chrome 和 firefox。
最佳答案
试试这个
#footer {
background: #000 url(images/cbf/foot.png) repeat;
border-top: solid 1px #000;
position: fixed;
bottom: 0;
width: 100%;
height: 180px;
clear: both;
}
关于html - 为什么我的页脚没有粘在底部?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14825029/