ie6 兼容性问题

1.在IE6下面同时用到float属性和和margin属性的时候,IE6会不兼容的,margin的值会是你设置的值得2倍,在CSS里面添加一个display:inline样式就可以解决问题

 

2.在IE6下面用到float:right的时候,IE6不兼容,导致换行,在CSS里面添加一个display:inline;overflow:hidden样式就可以解决问题

 

3.在IE6下面使用iframe出现垂直、水平滚动条,给iframe添加属性scrolling="no";如果只是不需要水平滚动条可以设置scrolling="yes",并且增加style="overflow-x: hidden"。

 

4.在IE6下面使用ul,标签固定的宽.高的情况下li的宽度设置为自动.以便于li的长度超出了ul的时候就不会自动换行, 给ul里面设置属性:white-space:nowrap;自动换行.补充:white-space 属性设置如何处理元素内的空白。

 

5.在IE6下面固定div在浏览器的底部或者头部,不兼容position:fixed,需要csshack。div 加样式:*.top{position:absolute;bottom:auto;top:expression_r(eval(document.documentElement.scrollTop));}

  *.bottom {position:absolute;bottom:auto;top:expression_r(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0)));}

  *.left {position:absolute;right:auto;left:expression_r(eval(document.documentElement.scrollLeft));}

  *.right {position:absolute;right:auto;left:expression_r(eval(document.documentElement.scrollLeft+document.documentElement.clientWidth-this.offsetWidth)-(parseInt(this.currentStyle.marginLeft,10)||0)-(parseInt(this.currentStyle.marginRight,10)||0));}

*html{background-image:url(about:blank);background-attachment:fixed;} /* 防震动 */

 

6.在IE6下,div,iframe宽高出现问题,有可能是未要注意写清楚height,width的值造成的

 

7.给行内元素定义宽度,如果你给一个行内元素定义宽度,那么它只是在IE6下有效. 所有的HTML元素要么是行内元素要么就好是块元素.

行内元素包括:<span>, <a>, <strong> 和 <em>. 块元素包括<div>, <p>, <h1>, <form>和<li> .

你不能定义行内元素的宽度, 为了解决这个问题你可以将行内元素转变为块元素,如:. span { width: 150px; display: block }

 

 

 

posted @ 2012-09-20 09:10  年华°  阅读(291)  评论(0编辑  收藏  举报