- .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等固定在指定位置的实现方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持PHP中文网。
更多html css 控制div或者table等固定在指定位置的实现方法相关文章请关注【创想鸟】!
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。