How to avoid ie8 compatibility button?

Viewed 31576

In IE8, the Microsoft introduced a new mode called compatibility mode which would render the page like IE7.

You can see this button next to address bar in stackoverflow.com. But when you access google.com / live.com, you would not see the compatibility mode button. How do we make sure the pages don't show this button the user?

6 Answers

Short answer:

Put this in your head tag to tell the browser that your page works in IE 8:

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

Also as per Jon Hadleys comment, to ensure the latest (not just IE8) rendering engine is used, you could use the following:

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

From here:

Sometimes the Compatibility View button isn’t displayed.

The button is located on the address bar next to the ‘stop’ and ‘refresh’ buttons. There are a few cases where there’s no action for a user take and, thus, the Compatibility View button will not show:

If you're viewing an internal-to-Internet Explorer page (such as about:InPrivate)

If you're viewing a page that has declared it's "ready" for Internet Explorer 8 through use of the versioning tag / HTTP header (it doesn’t matter if this tag triggers Quirks, IE7 Standards, or IE8 Standards, the button won’t be displayed)

If you're viewing an intranet page and you have the ‘Display intranet sites in Compatibility View’ checkbox selected If you're viewing any webpage and you have the ‘Display all websites in Compatibility View’ checkbox selected

If you're viewing a webpage that is included on the Microsoft-supplied compatibility view updates list and you have the ‘Include updated website lists from Microsoft’ checkbox selected

If you've toggled either the ‘Document Mode’ or ‘Browser Mode’ settings via the Developer Toolbar

So you're probably after the versioning tag / HTTP header which is described in more details in that blog post and over here.

Related