我在SO中浏览了同样的问题,但没有一个能很好地工作[跨浏览器兼容]。
所以,我正在寻找同样的工作来用 jQuery 来解决。
我想将 div 放置在 HTML 页面的底部,而不是屏幕的底部。
到目前为止我只尝试过 CSS
clear: both;
min-height: 6%;
position: fixed;
bottom: 0;
编辑
我的CSS
html, body {
margin: 0px;
padding: 0px;
height: 100%;
}
#footer {
width: 100%;
height: 6%;
position: absolute;
bottom:0px;
left:0px;
}
#content {
float: left;
width: 59.5%;
height: 83%;
position:relative;
}
#news {
z-index:2;
}
<html>
<div id="content">
<div id="news"> </div>
</div>
<div id="footer"></div>
<html>
最佳答案
关于javascript - 强制 div 到达底部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6743428/