【问题标题】:External style sheet for if IE containing all the IE style sheet rules如果 IE 包含所有 IE 样式表规则的外部样式表
【发布时间】:2015-09-12 22:21:57
【问题描述】:

我正在开发一个使用相当多的 ccs3 和 JS 的响应式站点,该站点有很多回退,因此它可以跨浏览器回到 IE8。对于几乎所有的 IE 版本,我在每个页面的 <head> 中都有这样的编写特定 IE 浏览器代码

/*CSS 样式*/
<!--[if lte IE 8]>
  <style>
    /*CSS STYLES*/
  </style>
<![endif]-->

<!--[if lt IE 8]>
  <style>
    /*CSS STYLES*/
  </style>
<![endif]-->

除了这样做会占用每个页面的头部空间之外,还可以这样做:

<!--[if lte IE 9]>
      <style>
        /*Go to a style sheet where all the above code is*/
      </style>
    <![endif]-->

我在这里尝试做的是允许 IE 打开一个单独的样式表,其中包含所有 IE 浏览器的所有上述规则,而不是必须为 &lt;head&gt; 中的每个 if IE 块设置外部样式表

【问题讨论】:

    标签: css internet-explorer cross-browser


    【解决方案1】:

    引用普通样式表的方式相同。

    <!--[if lt IE 9]>
        <link rel=stylesheet href="YOUR_FILE_HERE.css">
    <![endif]-->
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-06-29
      • 1970-01-01
      • 2015-01-04
      • 2015-04-04
      • 2014-04-24
      • 2011-10-25
      • 2011-09-07
      相关资源
      最近更新 更多