Search code examples
cssinternet-explorerinternet-explorer-10conditional-comments

Why are my IE conditional statements not working?


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?


Solution

  • 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.