2013-08-30 59 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