title: IE9 constantly using IE7 standards document mode no matter what I try
body: <p>This is driving me insane.</p>
  
  <p>No matter what I try, Internet Explorer is switching to IE7 Standards Document Mode.  I have tried stripping my code back to nothing to try and get it to behave, using HTML5 boilet plate AND HTML5 reset (whose own site goes into Quirks Mode).</p>
  
  <p>I have also added the meta tag that is supposed to force IE to it's latest version no matter what, but all that has done is made my mark-up invalid according to W3C.</p>
  
  <p>This is what I have; what am I missing?</p>
  
  <pre><code>&lt;!doctype html&gt;
  
  &lt;!--[if IE 7 ]&gt; &lt;html class="ie7&gt; &lt;![endif]--&gt;
  &lt;!--[if IE 8 ]&gt; &lt;html class="ie8&gt; &lt;![endif]--&gt;
  &lt;!--[if gt IE 8]&gt;&lt;!--&gt;&lt;html&gt;&lt;!--&lt;![endif]--&gt;
  
  &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;link rel="stylesheet" href="css/style.css"&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;p&gt;Test text&lt;/p&gt;        
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>I have a solution found via a suggestion below.  The suggestion didn't work, but it did lead me to an answer.  This might not be 100% suitable for everyone since it imposes a class on the <code>body</code> tag rather than <code>html</code>, but it works for me and seems to work for IE.</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"&gt;
      &lt;link rel="stylesheet" href="css/style.css"&gt;
  &lt;/head&gt;
  &lt;!--[if IE 7 ]&gt; &lt;body class="ie7&gt; &lt;![endif]--&gt;
  &lt;!--[if IE 8 ]&gt; &lt;body class="ie8&gt; &lt;![endif]--&gt;
  &lt;!--[if gt IE 8]&gt;&lt;!--&gt;&lt;body&gt;&lt;!--&lt;![endif]--&gt;
  &lt;p&gt;Test text&lt;/p&gt;        
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>