IE不同版本的兼容问题

 作为一名前端开发人员,跟IE的接触可是不少啊。这个大家都懂得,我也不多说了。今天又用到了(最近对IE6的兼容写的比较多),

所以我决定,将常用的兼容汇集总结下。下面我总结了一些IE下的hack:

 

    _    IE6独有
    * IE6,IE7
  \0  IE8
\9 IE8 ,9

 

 

 

 

 

 

 

配合@media使用的hack如下:

@media \0screen\,screen\9                        IE6,7,8
@media \0                        IE8

 

 

 

 

另:在IE6下对fixed属性的兼容支持:

.fixItem{

  position:fixed;

      _postion:absolute;

     bottom:0;

  _bottom:auto;

  right:20px;

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

IE6对固定在顶部的兼容

.fixItem{

  _position:absolute;

  _bottom:auto;

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

}

光用以上表达式的时候,我们会发现,在IE6下滚动滚动条时,固定在浏览器顶部分元素会有闪烁的效果,为避免这种闪烁的效果,在CSS中添加一下代码即可:

*html{

  background-image:url(about:blank);

  background-attachment:fixed;

}

 

 

这些是我目前用的较多的hack,不太全,先写这么多,后期再补全。

 

===================

IE11

_:-ms-fullscreen,:root .infoinput {
padding-top: 4px;
padding-bottom: 4px;
}

posted @ 2016-01-06 13:18  有间小屋在森林  阅读(239)  评论(0编辑  收藏  举报