首页 > Web开发 > 详细

css定位

时间:2016-02-04 18:41:06      阅读:242      评论:0      收藏:0      [点我收藏+]

关于css定位fixed定位不兼容ie6,ie7的解决方案

/距离上边为0/

.sl-fixed-top{

bottom:auto;

top:0;

_bottom:auto;

_top:expression(eval(document.documentElement.scrollTop)) 

}

/距离底部为0/

.sl-fixed-bottom{

bottom:0;

top:0;

_bottom:auto

_top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-(parseInt(this.currentStyle.marginTop,10||0)-(parseInt(this.currentStyle.marginBottom,10||0))));

}

/距离左边为0;

.sl-fixed-left{

 left:0;

_position:absolute;

right:auto;

_left:expression(eval(document.documentElement.scrollLeft)) 

}

/对于右边为0/

.sl-fixed-right{

right:0;

left:auto;

_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)i);

}

/Hack for ie6/

.sl-fixed-top,.sl-fixed-bottom,.sl-fixed-left,.sl-fixed-right{

_position:absolute;

}

css定位

原文:http://www.cnblogs.com/dangou/p/5182107.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!