IE BUG

it2022-05-09  24

 

float

当非float的元素和float的元素在一起的时候,如果非float元素在先,那么float的元素将被排斥,也就是说,你的span是float:right,但是你的a还是float:none 如果要让两者占据同一行,要么你把span先于a显示,要么把a也设成float(float:left).

http://www.enhanceie.com/ie/bugs.asp

 

条件注释<html>

条件注释<html>跟上面的方法原理一样,只不过这里是给<html>注释不同的class。

<!--[if lt IE 7 ]> <html class="ie6"> <![endif]--> <!--[if IE 7 ]> <html class="ie7"> <![endif]--> <!--[if IE 8 ]> <html class="ie8"> <![endif]--> <!--[if IE 9 ]> <html class="ie9"> <![endif]--> <!--[if (gt IE 9)|!(IE)]><!--> <html class=""> <!--<![endif]-->

这样在CSS中使用下面的代码即可区分版本

#content{background:red;} .ie9 #content{background:orange;} .ie8 #content{background:yellow;} .ie7 #content{background:green;} .ie6 #content{background:blue;}

IE6中利用容器对溢出内容的处理方式来实现的 <!--[if IE 6]> 利用IE独有的条件语句可以针对不同的IE版本精确设置,同时避免了这些代码被其他浏览器读到 <style type="text/css"> html{overflow:hidden;} body{height:100%;overflow:auto;} #fixed{position:absolute;right:17px;} fixed元素的绝对位置是相对于HTML元素来说,而滚动条是body元素的,这是设置right:17px的原因 </style> <![endif]-->

转载于:https://www.cnblogs.com/caroar/archive/2012/11/13/2768014.html


最新回复(0)