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.
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');
}
#mydiv{
position: fixed;
bottom: 0px;
}
精彩评论