该如何实现?
回复讨论(解决方案)
testing
http://hi.baidu.com/iamzhangxinxu/blog/item/f4b1f550d65cdd10367abe9d.html
到底要底部哪个位置,自己改下left:***
#foot{position:fixed;_position:absolute;bottom:0px;_bottom:0px;_margin-top:expression(this.style.pixelHeight+document.documentElement.scrollTop)}
试下。
我的意思是随便找个页面,粘贴上这段代码,这个div就可以固定浮动在页面最低端,
拖动滚动条浏览始终在最低端
testing 我不在下面?
document.getElementById("shows").style.top=(document.documentElement.scrollTop || document.body.scrollTop)+ieheight-5-showsHeight+"px"; 居屏幕底部。
HTML code
这位大哥写的确实没错,
不过我的要求是就一个div标签,
比如新建一个html,内容就是
我不在下面?
保存,不能有body和html,head标签,style就不起作用?
我的意思是随便找个页面,粘贴上这段代码,这个div就可以固定浮动在页面最低端,
拖动滚动条浏览始终在最低端
这个不能用吗?
我要固定浮动在底部
引用 4 楼 coolzdp 的回复:
我的意思是随便找个页面,粘贴上这段代码,这个div就可以固定浮动在页面最低端,
拖动滚动条浏览始终在最低端
这个不能用吗?
HTML code
不能啊,我的意思是只有div标签,没有body,style就不起作用了好像
html, body {
margin: 0;
padding: 0;
height: 100%;
width: 100%;
_overflow: hidden;
}
#container {
_width: 100%;
_height: 100%;
_overflow-y: scroll;
}
#bottom {
background-color: #0ff;
height: 30px;
width: 100%;
position: fixed;
bottom: 0;
z-index: 999;
/* ie6 fixed */
_position: absolute;
_bottom:-1px;
_right: 17px;
}
核心样式就两句:一句是position:fixed,另一句是bottom:0。
zell419 代码很正确,火狐,IE都兼容!
不错,很好很强大
我想问下,就在此情况下,能否让其也同时水平居中呢???
能同时实现水平居中么?
[Quote=引用 6 楼 的回复:]
document.getElementById("shows").style.top=(document.documentElement.scrollTop || document.body.scrollTop)+ieheight-5-showsHeight+"px";
这个可以~~