IE6中的position:fixed定位兼容性写法分享

网站建设 2023-01-28 21:39www.1681989.com免费网站
非IE6下的写法大家一般都清楚如何写;这里就不展示了;
切入正题,以下的IE6下CSS的兼容性写法

复制代码
代码如下:

/ 修正IE6振动bug /
html, html body{background-image:url(about:blank);background-attachment:fixed;}
/ IE6 头部固定 /
html .fixed-{position:absolute;bottom:auto;:expression(eval(document.documentElement.scrollTop));}
/ IE6 右侧固定 /
html .fixed-right{position:absolute;right:auto;left:expression(eval(document.documentElement.scrollLeft+document.documentElement.clientWidth-this.offsetWidth)-(parseInt(this.currentStyle.margLeft,10)||0)-(parseInt(this.currentStyle.margRight,10)||0));}
/ IE6 底部固定 /
html .fixed-bottom{position:absolute;bottom:auto;:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.margTop,10)||0)-(parseInt(this.currentStyle.margBottom,10)||0)));}
/ IE6 左侧固定 /
html .fixed-left{position:absolute;right:auto;left:expression(eval(document.documentElement.scrollLeft));}

不信?还不去试试?

Copyright © 2016-2025 www.1681989.com 推火网 版权所有 Power by