I have the following:

  <!--[if IE]>
    <style>
      iframe {
        margin-top: 0 !important;
        display: none;
      }
      .c-position {
        margin-top: 20px !important;
      }
      br {
        display: none;
      }
    </style>
  <![endif]-->

But when I see my site in IE10 The CSS within the IE conditional statements are not being applied (e.g. the iframe should disappear).

I even tied this:

  <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9">

So IE10 recognizes the conditional statements.

Why am I doing wrong?

有帮助吗?

解决方案 2

IE10 does not support conditional comments.

Source quote:

Support for conditional comments has been removed in Internet Explorer 10 standards and quirks modes for improved interoperability and compliance with HTML5. This means that Conditional Comments are now treated as regular comments, just like in other browsers.

其他提示

Perhaps you can try some jQuery for ie10 like this:

if ($.browser.msie && $.browser.version == 10) {
  $("html").addClass("ie10");
}

But surely it is not replacement for conditional comments!

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top