IE8的特定样式表

时间:2010-05-08 15:50:51

标签: css internet-explorer internet-explorer-8

如何为Internet Explorer 8制作特定的CSS样式表?

我的意思是,只有在浏览器是IE8的情况下才能加载它? (而不是IE7和IE6)

3 个答案:

答案 0 :(得分:10)

使用此

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

答案 1 :(得分:8)

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

http://www.quirksmode.org/css/condcom.html

答案 2 :(得分:5)

您可以使用以下内容:

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