手机
当前位置:查字典教程网 >网页设计 > Div+Css教程 >ie6,ie7,ie8完美支持position:fixed的终极解决方案
ie6,ie7,ie8完美支持position:fixed的终极解决方案
摘要:ie6对position:fixed不支持,网上有很多解决方法,有的在ie6,ie7上调试成功后,在ie8上又不好使,div层还是跟随滚动条...

ie6对position:fixed不支持,网上有很多解决方法,有的在ie6,ie7上调试成功后,在ie8上又不好使,div层还是跟随滚动条浮 动;以下总结方法,在ie6,ie7,ie8上都调试成功,且页面滚动条滚动时,效果还挺好,div层并不会闪烁。

复制代码 代码如下:

<div id="goTop_div"> </div>

css:

复制代码 代码如下:

.fixed{

position:fixed; /*对于火狐等其他浏览器需要设置的*/

top:700px; /*同上*/

width:30px;

height:30px;

cursor:pointer;

display:none;

}

.ie{

_position: absolute;

_clear: both;

_top:expression(eval(document.compatMode &&

document.compatMode=='CSS1Compat') ?

documentElement.scrollTop

+(documentElement.clientHeight-this.clientHeight) - 1

: document.body.scrollTop

+(document.body.clientHeight-this.clientHeight) - 1);

}

【ie6,ie7,ie8完美支持position:fixed的终极解决方案】相关文章:

怎样在网页中显示虚线

div标签中的元素margin-top失效的解决方法

firefox中div+css的外层背景色不见的解决方法

网页中表单按回车就自动提交的问题的解决方案

纯CSS3实现带动画效果导航菜单无需js

使用position:fixed属性让DIV居中

div嵌套 img 空白解决方法

清除行内元素之间HTML空白的几种解决方案

CSS样式:background-position的理解

IE6下图片下方有空间距的多种解决方法

精品推荐
分类导航