2

IE11 Enterprise mode is introduced to emulate the IE8 in IE11 including its user agent and ActiveX but IE conditional statement, but IE11 in Enterprise mode is not supporting the IE conditional statement which should have been supported in IE11 Enterprise mode, as most of us like me coded css using conditional div for IE8 where CSS3 prop are not supported.

The conditional statement is removed from IE10 but in IE10 with IE8 Doc mode this conditional statement is working, see the screenshot below.

enter image description here

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
        <style>
            body{font-size:16px}
            #colorRed{color:red}

        </style>
    </head>

    <body>

      <!--[if IE 8]><div id="colorRed">I am in IE8, cond statement working</div><![endif]-->

        <div class="colorGreen">Hello World!</div>

    </body>

</html>

Result Expected : It should have displayed the colorRed Div, but it is not in Enterprise Mode.

Ideally the enterprise mode is introduced to emulate everything as in IE8, but this feature is missing , i already went throught this SO post There document mode is discussed but not enterprise mode, here i tested with enterprise mode same result. Any update on this, my IE version is

Thanks in advance for any help.

enter image description here

Community
  • 1
  • 1
Mohamed Hussain
  • 7,433
  • 14
  • 55
  • 85
  • What does your compatibility view settings say? – Sai Mar 13 '15 at 15:49
  • 1
    refer http://stackoverflow.com/questions/23369132/ie-conditional-statement-displaying-div-even-though-the-condition-says-it-should for ideas – Sai Mar 13 '15 at 15:52
  • @Sai: Compatibility settings says 8 Default. Eevn the console behave like how it is in IE8, no intellisense in Enterprise mode – Mohamed Hussain Mar 13 '15 at 16:16
  • you have to uncheck the box that says "use compatibility view for intranet sites". I am assuming that you are trying to access the page on internal network – Sai Mar 13 '15 at 16:19
  • @Sai that is unchecked only – Mohamed Hussain Mar 13 '15 at 16:26
  • I wasn't able to make the IE conditionals work with Enterprise Mode either. Luckily, I have Modernizr, and IEOld doesn't support canvas, but newer IE does, so I was able to key off html.no-canvas to identify IEOld. So utterly hacky...but we're transitioning to IE11 quickly, so this sin won't persist. – Jeromy French Jul 22 '16 at 06:41

1 Answers1

1

I suggest trying with the simple conditional <!--[if IE ]> - as suggested in this article I've found a while ago.

I would also suggest that you use virtual machines available for free from modern.ie as IE emulation in more recent versions has always been notoriously unreliable!

Luca
  • 9,259
  • 5
  • 46
  • 59