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

  发布时间:2014-05-12 09:56:42   作者:佚名   我要评论
这篇文章主要介绍了IE6中的position:fixed定位兼容性写法分享,需要的朋友可以参考下
(福利推荐:【腾讯云】服务器最新限时优惠活动,云服务器1核2G仅99元/年、2核4G仅768元/3年,立即抢购>>>:9i0i.cn/qcloud

(福利推荐:你还在原价购买阿里云服务器?现在阿里云0.8折限时抢购活动来啦!4核8G企业云服务器仅2998元/3年,立即抢购>>>:9i0i.cn/aliyun

非IE6下的写法大家一般都清楚如何写;这里就不展示了;
切入正题,以下的IE6下CSS的兼容性写法:

复制代码
代码如下:

/* 修正IE6振动bug */
html,* html body{background-image:url(?about:blank);background-attachment:fixed;}
/* IE6 头部固定 */
html .fixed-top{position:absolute;bottom:auto;top: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.marginLeft,10)||0)-(parseInt(this.currentStyle.marginRight,10)||0));}
/* IE6 底部固定 */
html .fixed-bottom{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)));}
/* IE6 左侧固定 */
* html .fixed-left{position:absolute;right:auto;left:expression(eval(document.documentElement.scrollLeft));}

不信?还不去试试?

相关文章

最新评论


http://www.vxiaotou.com