我有一个固定宽度的DIV,我想让它保持在浏览器窗口视图的底部。
不幸的是,我不知道该从哪里开始实现。
显然,第一件事是将 position
设置为 fixed
。但除此之外... 一无所知。
请参考css-tricks网站:
CSS:
#footer {
position:fixed;
left:0px;
bottom:0px;
height:30px;
width:100%;
background:#999;
}
/* IE 6 */
* html #footer {
position:absolute;
top:expression((0-(footer.offsetHeight)+(document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight)+(ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop))+'px');
}
#mydiv{
position: fixed;
bottom: 0px;
}