<style>
.fixed-top /* 头部固定 */{position:fixed;bottom:auto;top:0px;}
.fixed-bottom /* 底部固定 */{position:fixed;bottom:0px;top:auto;}
.fixed-left /* 左侧固定 */{position:fixed;right:auto;left:0px;}
.fixed-right /* 右侧固定 */{position:fixed;right:0px;left:auto;}
/* 上面的是除了IE6的主流浏览器通用的方法 */
* html,* html body /* 修正IE6振动bug */{background-image:url(about:blank);background-attachment:fixed;}
* html .fixed-top /* IE6 头部固定 */{position:absolute;bottom:auto;top:expression(eval(document.documentElement.scrollTop));}
* html .fixed-right /* IE6 右侧固定 */ {position:absolute;right:auto;left:expression(eval(document.documentElement.scrollLeft+document.documentElement.clientWidth-this.offsetWidth)-(parseInt(this.currentStyle.marginLeft,10)||0)-(parseInt(this.currentStyle.marginRight,10)||0));}
* html .fixed-bottom /* IE6 底部固定 */{position:absolute;bottom:auto;top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0)));}
* html .fixed-left /* IE6 左侧固定 */{position:absolute;right:auto;left:expression(eval(document.documentElement.scrollLeft));}
</style>
十分强悍的代码,要用fixed的时候直接给元素赋相应的类就可以
分享到:
相关推荐
纯css兼容IE6的fixed定位不上下晃动!
IE会让相邻的也浮动起来,Chrome 和FF不会,他们的float对象不再占据空间,所以显示效果也不同。 Chrome 下 IE <style> body{ padding:0; margin:0;} #yi{ background:#0033FF; height:298px; width:298px...
这个内容是老生常谈了,主要问题就是IE6不支持 position:fixed 引起的BUG.当我们去搜索解决这个bug的垮浏览器解决办法时,绝大多数结果都是说使用 position:absolute 来替代解决,可是我们真的解决了么?没有,因为当页面...
解决IE6下不支持fixed问题!~如果项目中有亟待解决的问题,这个可是神方哦,超级简单!
一般的IE6 fixed都会抖动,很难看,童叟无欺,绝对不抖动
兼容IE6的Fixed定位示例,通过Exp和JS判断浏览器,然后选择是否降级
轻松解决ie6下头部定位的问题,如果你还在为你的定位问题犯愁,就赶快下载资源看看吧
NULL 博文链接:https://onestopweb.iteye.com/blog/2339092
Cheetahmen II bugfix IPS patch
切入正题,以下的IE6下CSS的兼容性写法: 复制代码代码如下:/* 修正IE6振动bug */html,* html body{background-image:url(about:blank);background-attachment:fixed;}/* IE6 头部固定 */...
positon:fixed 让HTML元素脱离文档流固定在浏览器的某个位置 网页中经常会有浮动的导航条会用到这种定位模式,但是ie6下并不兼容这种定位 浮动导航条的样式,重要的是position:fixed;bottom:60px;(浮动导航底部距离...
关于IE6,虽然它已被微软抛弃很久了,但是由于大天朝的特殊行情(盗版)对于前端工程师来说,解决IE6兼容position:fixed的问题显得很重要。特别是你需要用到头尾悬停调用的时候
ie6对position:fixed不支持,网上有很多解决方法,有的在ie6,ie7上调试成功后,在ie8上又不好使,div层还是跟随滚动条浮 动;以下总结方法,在ie6,ie7,ie8上都调试成功,且页面滚动条滚动时,效果还挺好,div层并...
用超简单代码在IE6中实现了fixed效果,顺便带了个返回顶部功能
Fixed Income Trading Platform Architecture Khader Vali Shaik
完美解决IE6不支持position:fixed的bug,需要的朋友可以参考下。
} 这个方法有一个bug未解决:在IE6下会把所有position:absolute都变成“浮动”的元素;还有使用js方法滚动滚动条时会出现对象闪烁,如下方法结合了CSS和js的办法,解决了以上的问题。 代码如下: <!DOCTYPE ...
第一排给Firefox以及其他浏览器看 第二排给IE7(可能以后的IE8、IE9也是如此,谁知道呢)看 第三排给IE6以及更老的版本看 最好的应用就是可以让IE6也“支持”position:fixed,而且,配合这个原理,可以做到不引入...
E_FIXED_LC/D_LC,Digital Watermarking and Steganography system,side information