1

I am using following code snippet to force IE's latest mode to run. Though I am using "Edge", for some reason IE is always opened in Document mode IE 7 standards.

<!DOCTYPE html>
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]>    <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
<head>

    <!-- Meta-Information -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
</head>

I am working on an intranet site, so I have checked the tools -> compatibility settings -> display intranet sites in compatibility view is checked.

I thought this is the reason, my web page is getting opened in compatibility mode and there is no easy way around it as I can't ask every user to change these settings.

I removed following modernizr code snippet from the html page and my web page opens in Document mode Internet explorer IE9 standards

<!DOCTYPE html>
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]>    <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->

Does anyone know what is the relation between document mode being set to 7 and above modernizer specific code snippet.

Note: I haven't disabled "display intranet sites in compatibility view" settings, it is still checked and after removing modernizer my page loads in IE9 standards mode and displays correctly

Rocky
  • 391
  • 7
  • 20
  • May be related to this http://stackoverflow.com/questions/6529728/html5-doctype-putting-ie9-into-quirks-mode – Sergiu Paraschiv May 19 '15 at 08:54
  • Unfortuantely, it is not related. I have taken care of all the stuffs mentioned in the post. – Rocky May 19 '15 at 09:26
  • 1
    The this is: https://github.com/h5bp/html5-boilerplate/issues/378 Issue is caused by the comments before ``. Only way of fixing this is to move them somewhere else. – Sergiu Paraschiv May 19 '15 at 11:21

0 Answers0