【问题标题】:IE9 class calls in an external css stylesheet not working外部 CSS 样式表中的 IE9 类调用不起作用
【发布时间】:2014-04-16 19:02:49
【问题描述】:

我目前正在运行此代码。我还有一个外部样式表,可以正确应用我所有的页面样式,但我目前正在处理这个问题。

当我在外部样式表中将 .ie9 作为类调用并希望对其应用渐变样式时,它并没有在 Internet Explorer 仿真中运行我的代码。

但是,当我运行不在 .ie9 类中的代码时,代码实际上可以工作,所以我在某处犯了一些错误。也许您可能知道这里的问题所在。

HTML 代码:

<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!--><html lang="nl-NL"> <!--![endif]-->
<!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

CSS 代码:

.ie9 {
    .section-example{
        filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#80c9db', EndColorStr='#30aac8');     
     }
}

【问题讨论】:

  • 不应该只是.ie9 .someclass { }
  • 啊,是的,这实际上是这里的问题,只是实现了错误的类调用。感谢您帮助我尼克 R!

标签: html css internet-explorer internet-explorer-9


【解决方案1】:

问题实际上是不同的。 Internet Explorer 11 模拟器由于某种原因不加载条件 html 语句。

【讨论】:

    【解决方案2】:

    它可能适用于大于 ie9:-

    <!--[if gte IE 9]>
        <link rel="stylesheet" type="text/css" href="ie9-and-up.css" />
    <![endif]-->
    

    <!--[if lt IE 9]>
    <link href="<?php bloginfo( 'template_url' ); ?>/css/ie9.css" rel="stylesheet" type="text/css" />
    <![endif]-->
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-06-24
      • 1970-01-01
      • 2019-08-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-12
      • 1970-01-01
      相关资源
      最近更新 更多