Search code examples
htmlinternet-explorerinternet-explorer-11conditional-comments

Why are conditional comments in HTML not recognized in Internet Explorer 11? Is it not supported now?


I want to display different content on different browsers. I used Internet Explorer 11 and Google Chrome 39. But, in Internet Explorer and all other browsers "Not Internet Explorer" is displayed. Is something wrong with the code? I saw the following code as an answer to one of the same question , then why it is not working now?

code:

<!DOCTYPE html>
<html>
<body>

<!--[if (IE)]><p>This is Internet Explorer</p><![endif]-->

<!--[if !(IE)]><!--> Not Internet Explorer <!--<![endif]-->

</body>
</html>

Solution

  • Microsoft dropped conditional comments in Internet Explorer as of version 10.