html css 控制div或者table等固定在指定位置的实现方法
- .bottomTable{
- background-color: rgb(249,249,249);
- z-index:99999999; position:fixed; bottombottom:0; left:0; width:100%; _position:absolute; /* for IE6 */
- /* _top: expression(document.body.scrollTop+document.body.clientHeight-this.offsetHeight); */
- _top: expression(document.body.scrollTop+document.body.clientHeight-this.offsetHeight-6); /* for IE6 */
- overflow:visible;
- }
1、z-index:设置层处于最顶层。
2、position:fixed;设置定位。
3、_top: expression(document.body.scrollTop+document.body.clientHeight-this.offsetHeight-6);通过css绑定js控制层距顶端的高度,
此处是控制层处于底部,具体数值根据需求作相应的调整。
4、document.body.scrollTop:body,body标签滚动条滚动的距离,可更换为你其它标签对象(存在滚动条)。
5、document.body.clientHeight,body标签的高度,可更换为你其它标签对象。
6、-6,距具体情况作相应改动。
以上这篇html css 控制div或者table等固定在指定位置的实现方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持我们。
原文地址:http://www.cnblogs.com/skycsdn/archive/2016/06/13/5580009.html
您可能感兴趣的文章
- 01-10通过html为FLASH加链接的实现代码(div层)
- 01-10IE浏览器HTML Hack标签总结
- 01-10html用style添加属性示例
- 01-10HTML中rel属性分析
- 01-10HTML元素设置焦点的方法
- 01-10在html文件里include文件内容的方法小结
- 01-10常用HTML meta 标签属性(网站兼容与优化需要)
- 01-10用HTML和CSS打造属于自己的暖男“大白”
- 01-10XHTML中的常用标签整理
- 01-10利用HTML实现限制ip的投票网站作弊方案