当前位置:主页 > 查看内容

html css 控制div或者table等固定在指定位置的实现方法

发布时间:2021-04-27 00:00| 位朋友查看

简介:CSS Code 复制内容到剪贴板 .bottomTable{ background-color : rgb (249,249,249); z-index :99999999; position : fixed ; bottom bottom :0; left :0; width :100%;_position: absolute ; /*forIE6*/ /*_top:expression(document.body.scrollTop+document.……
CSS Code复制内容到剪贴板
  1. .bottomTable{    
  2. background-colorrgb(249,249,249);    
  3. z-index:99999999; position:fixedbottombottom:0; left:0; width:100%; _position:absolute/* for IE6 */  
  4. /* _top: expression(document.body.scrollTop+document.body.clientHeight-this.offsetHeight);    */  
  5. _top: expression(document.body.scrollTop+document.body.clientHeight-this.offsetHeight-6); /* for IE6 */  
  6. overflow:visible;   
  7.  }  

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


原文链接:https://m.jb51.net/web/468110.html
本站部分内容转载于网络,版权归原作者所有,转载之目的在于传播更多优秀技术内容,如有侵权请联系QQ/微信:153890879删除,谢谢!
上一篇:HTML学习笔记--HTML的语法详解(必看) 下一篇:没有了

推荐图文


随机推荐