如何css控制div始终在整个页面最底部

我的页面是自适应高度,怎么用css控制我的div:bottom不管页面高度多少始终在页面最低端?谢谢

var AdDivW = 100; //宽度
var AdDivH = 150; //高度
function scall(){
document.write ('<div id="Javascript.LeftDiv" style="position: absolute;border: 1px solid #336699;background-color:#EEEEE2;z-index:1000;width:'+AdDivW+'px;height:'+AdDivH+'px;top:-1000px;word-break:break-all;display:none;">'+ClosebuttonHtml+'<div>'+AdContentHtml+'</div></div>');

var Toppx = window.screen.height-AdDivH;
document.getElementById("Javascript.LeftDiv").style.top=document.body.scrollTop+Toppx;
}
window.onscroll=scall;
window.onresize=scall;
window.onload=scall;
温馨提示:内容为网友见解,仅供参考
第1个回答  2013-04-05
在没有使用定位的祖先元素中,使用绝对定位就会以浏览器窗口位定位基准:
.bottom{
position:absolute;
bottom:0px;
}
第2个回答  2013-04-05
suspendcode12="<DIV id=\"lovexin12\" style='right:0px;POSITION:absolute;TOP:350px;z-index:100'>";
第3个回答  2017-07-06
设置position:absolute; 然后设置bottom:0;
第4个回答  2013-04-05
div style="position:absolute;bottom:0px;"
相似回答