如何将页脚固定在页面底部
来源:互联网 发布:腾讯模拟炒股软件 编辑:程序博客网 时间:2024/05/21 09:53
参考文档:http://www.kuqin.com/webpagedesign/20111220/316487.html
方法一:(js来完成,让底部的ID的值与括号“bottom”一样。)
<script language="JavaScript" type="text/javascript">
function test(){
var infoHeight = document.getElementById("info").scrollHeight;
var bottomHeight = document.getElementById("bottom").scrollHeight;
var allHeight = document.documentElement.clientHeight;
var bottom = document.getElementById("bottom");
if((infoHeight + bottomHeight) < allHeight){
bottom.style.position = "absolute";
bottom.style.bottom = "0";
}else{
bottom.style.position = "";
bottom.style.bottom = "";
}
setTimeout(function(){test();},10);
}
test();
</script>
方法二:(css来完成)
div { style="background:#ededed;height:31px;width:100%;position:fixed;left:auto;right:auto;bottom:0;_position:absolute;_top:expression(document.documentElement.clientHeight + document.documentElement.scrollTop - this.offsetHeight);text-align:center;"}
- 如何将页脚固定在页面底部
- 如何将页脚固定在页面底部
- 如何将页脚固定在页面底部
- 如何将页脚固定在页面底部
- 如何将页脚固定在页面底部
- 如何将页脚固定在页面底部
- 如何将页脚固定在页面底部
- 前端 如何将页脚固定在页面底部
- 如何将页脚固定在页面底部
- 如何将页脚固定在页面底部
- 将页脚固定在页面底部
- 将页脚固定在页面底部
- [Front-end] 如何将页脚固定在页面底部
- 如何将页脚固定在页面底部(多种方法实现)
- 如何将页脚固定在页面底部(多种方法实现)
- 如何将页脚固定在页面底部(sticky footer)
- 将页脚固定在页面的底部
- Flexbox如何将页面底部固定在屏幕最下方
- Portal和Portlet容器的区别是什么?
- RDS电台 TA 与 AF解释
- 我的Android之旅——学习、项目、心态
- Java反射复习整理
- 生成指定长度的随机字符串
- 如何将页脚固定在页面底部
- 协议大全
- c#文件操作大全(一)
- CSDN上的第一篇博客
- JavaScript函数补完:toString()
- oracle 数据导入 ——.bmp
- 鲁政委利率市场化应与金融市场深化协调推进 ,
- c#文件操作大全(二)
- 我的java日记(基础上)