我有,我想留在浏览器的视口底部的固定宽度的DIV。
I have a fixed-width DIV that I want to remain at the bottom of the browser's viewport.
不幸的是,我还没有线索,我甚至会开始尝试实现这一点。
Unfortunately, I haven't a clue where I would even begin to try to implement this.
显然,要做的第一件事是将位置
到固定
。但除此之外......不知道。
Obviously the first thing to do is set position
to fixed
. But beyond that... no clue.
请参阅在CSS-招数:
See at css-tricks:
固定页脚
Fixed Footer
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');
}