2010-08-17 92 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. -->