【问题标题】:how to load browser specific external css files? [duplicate]如何加载浏览器特定的外部 css 文件? [复制]
【发布时间】:2014-05-11 18:49:26
【问题描述】:

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

这可能吗?

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

</head>

【问题讨论】:

  • 这个问题已经被问了100次了,请在添加另一个到重复堆之前搜索您的问题,上面添加了一个链接到其中一个

标签: javascript css internet-explorer


【解决方案1】:
<!--[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]-->

【讨论】:

    【解决方案2】:

    简单

    <!--[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]--> 
    

    【讨论】:

      猜你喜欢
      • 2011-07-15
      • 2013-07-27
      • 1970-01-01
      • 1970-01-01
      • 2011-12-21
      • 2010-09-12
      相关资源
      最近更新 更多