Crasher
Crasher

Reputation: 123

Why does IE9 change to Compatibility View mode automatically?

A little Question from my side. I'm working on a new internal Webpage at my Company which should be optimizied for Internet Explorer 9. So far I have to following HTML Code:

<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<title>Intranet</title>

</head>

<body>
    <div id="wrapper">
        <div id="navigation">
            nav
        </div>
        <div id="content">
            content
        </div>
        <div id="content_shadow"></div>
        <div id="right">
            <a href="/"><img src="/gfx/logo.png" alt="alt" title="title" class="logo" /></a>
        </div>
        <br class="clear" />
    </div>
</body>
</html>

For any reason Internet Explorer shows me the symbol that there are compatibility issues in my side, when I click on it there's not really a change at all but I'm just wondering why the compatibility icon apears? Is there something wrong at my code?

Thanks for your help

Upvotes: 2

Views: 108

Answers (3)

Vitor Canova
Vitor Canova

Reputation: 3976

Intranet sites by default are loaded in compatibility mode by default.

You need to use a X-UA-Compatible meta tag to achieve what you want in intranet sites without change IE settings.

<meta http-equiv="X-UA-Compatible" content="IE=9" />

Since you making it compatible with IE9 looks like you are using many Web Standards. So I reccomend you say do IE to use the newer engine available instead of just fix it to IE9:

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

In this case if you are using IE10 or IE11 (currently in preview) it will use their best engine instead of always IE9.

More information about Specifying legacy document modes.

Upvotes: 2

Christoph
Christoph

Reputation: 51261

For intranetsites you need the following meta tag to display the site correctly:

<meta http-equiv="X-UA-Compatible" content="IE=9" />

or if you don't want to force IEs > 9 degrade to IE9 view, then use:

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

Upvotes: 0

Murtuza Kabul
Murtuza Kabul

Reputation: 6524

Probably because you have not explicitly defined the page compatibility.

Go through this link http://msdn.microsoft.com/en-us/library/cc288325(v=vs.85).aspx

It will explain you how to explicitly define it.

Also read this answer. It explains it very well

Why does IE9 switch to compatibility mode on my website?

Upvotes: 1

Related Questions