2010-08-17 87 views
5

海兰那里......IE CSS条件包括

我不得不使用Internet Explorer条件注释的一个问题...

我用这个条件

<!--[if lte IE8]> 
<link rel="stylesheet" type="text/css" href="http://www.bvp.hr/Static/Style/IEFix6.css"/> 
<![endif]--> 

的问题是,在< IE8 .0我在任何其他输出之前获得输出<!--[if lte IE8]><![endif]--> ...为什么?!?在Firefox中,它被正常渲染(afkors)。

回答

6

我相信所有你需要做的就是添加IE8之间的空间,所以它看起来是这样的:

<!--[if lte IE 8]> 
<link rel="stylesheet" type="text/css" href="http://www.bvp.hr/Static/Style/IEFix6.css"/> 
<![endif]--> 
+0

仅供参考:http://www.quirksmode.org/css/condcom.html – lunohodov 2010-08-17 15:28:34

2
<!--[if IE 6]> 
Special instructions for IE 6 here 
<![endif]--> 

在上面的例子,那里有IE和6之间的空间就做同样的IE 8:

<!--[if lte IE 8]> 
<link rel="stylesheet" type="text/css" href="http://www.bvp.hr/Static/Style/IEFix6.css"/> 
<![endif]--> 
0

见上面加在你的代码的顶部的意见将迫使IE浏览器进入怪癖模式,这将使得页面的渲染差。删除这些评论:

<!-- UUIDM component start --> 
<!-- Page generated by UUIDM component - part of WebSuite application platform. Copyright (C) Determinanta. All rights reserved. -->