2013-08-30 61 views

回答

1

相似,在頭下面的地方被發現。

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

這會爲您選擇它的任何瀏覽器中運行,可以考慮:

<!--[if lt IE 9]> 
your css in here 
<![endif]--> 

這將顯示你指定的規則,如果瀏覽器是IE 8或更低。

0

對於IE,你可以使用:

<!--[if IE]> 
<link rel="stylesheet" type="text/css" href="iespecific.css" /> 
<![endif]--> 

對於Mozilla,你可以使用:

<style type="text/css"> 
@-moz-document url-prefix() { 
    h1 { 
     color: red; 
    } 
    // all styles for mozilla alone 
} 
</style> 
1

對於任何Mozilla瀏覽器使用:

@-moz-document url-prefix() 
{ 
    // Styles for mozilla goes here 
} 

對於特定的IE使用以下內容。這IE 8

<!--[if IE 8]> 
<link rel="stylesheet" type="text/css" href="ie8specific.css" /> 
<![endif]--> 

對於IE 7和下部版本

<!--[if lt IE 8]> 
    <link rel="stylesheet" type="text/css" href="ie7-and-down.css" /> 
<![endif]--> 

對於IE 7和更高版本

<!--[if gt IE 6]> 
    <link rel="stylesheet" type="text/css" href="ie7-and-up.css" /> 
<![endif]--> 

OR

<!--[if gte IE 7]> 
    <link rel="stylesheet" type="text/css" href="ie7-and-up.css" /> 
<![endif]--> 

如果你想使用內聯CSS的IE,則不是鏈接到一個CSS文件,在condtion之間添加樣式。

<!--[if gte IE 7]> 
     <style> 
        // Style for IE 7 and higher versions. 
      </style> 
<![endif]--> 
+0