如何加载浏览器特定的外部 CSS 文件

how to load browser specific external css files?

本文关键字:外部 CSS 文件 浏览器 何加载 加载      更新时间:2023-09-26

我需要在我的页面头中添加对外部 css 文件的引用。但它应该只为IE浏览器添加。

这可能吗?

<head>
<link type="text/css" rel="stylesheet" href="/themes/jfile.css" />
</head>

简单

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

<!--[if lt IE 9]>
    According to the conditional comment this is IE lower than 9<br />
<![endif]--> 
<!--[if IE 6]>
    <link rel="stylesheet" href='/Common/Css/ie6.css' type="text/css" />
<![endif]-->
<!--[if IE 7]>
    <link rel="stylesheet" href='/Common/Css/ie7.css' type="text/css" />
<![endif]-->
<!--[if IE 8]>
    <link rel="stylesheet" href='/Common/Css/ie8.css' type="text/css" />
<![endif]-->