How to avoid ie8 compatibility button?

Solution 1:

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">

Solution 2:

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.

Solution 3:

If the "Display intranet sites in Compatibility View" or "Display all websites in Compatibility View" settings (found under Tools -> Compatibility View Settings) are enabled (as they relate to the website being viewed), then no matter what you have in the HTML of the document, the page will always be put in to some form of compatibility view.

This means that, even with in the document, you will still notice that the page is put in to compatibility view, and nothing you can do except disabling those settings will disable it, unfortunately.