htmlinternet-explorerie-compatibility-mode

IE issue with compatibility modes


I was wondering when I put my browser in compatibility mode, how does it know what setting to use from the header tags found in the document. If we have logic for all versions back to EI7, will it use the furthest back? So in this case, it chooses 7 in comp mode, but if we only offered back to IE8, then it would choose IE8 for that instance? So the question is, why does IE 11 compatibility mode set it to IE7 standards according to my debugger in IE? If I remove the [if IE7] code snippet, will it then set it to IE8 standards in the browser? We just quit supporting IE7 so am why I am asking this.

[if IE 7 ]>    <html class="ie7"
[if IE 8 ]>    <html class="ie8" 
[if IE 9 ]>    <html class="ie9"

Solution

  • In addition, the way you view your pages also affects the document mode.

    For best results:

    1. Use the HTML5 <DOCTYPE> directive.
    2. Use an x-ua-compatible meta with content set to IE=edge.
    3. View local pages through a local webbrowser.
    4. Code for HTML5, detect features, provide graceful fallback, and worry less about individual differences between individual browsers.

    Hope this helps...

    -- Lance