Using X-UA-Compatible to render websites in compatibility mode (2024)

A compatibility mode is a software mechanism in which a software either emulates an older version of the software or mimics another operating system to allow older or incompatible software or files to remain compatible with the computer’s newer hardware or software.

One of the most common and practical examples of compatibility mode is browsers rendering websites in compatibility mode

“Compatibility View” is a compatibility mode feature of the web browser Internet Explorer in version 8 and later. When active, Compatibility View forces IE to display the webpage in Quirks mode as if the page were being viewed in IE7. When compatibility view is not activated, IE is said to be running in native mode.

Internet Explorer 8 was promoted by Microsoft as having stricter adherence to W3C described web standards than Internet Explorer 7. As a result, as in every IE version before it, some percentage of web pages coded to the behavior of the older versions would break in IE8. This would have been a repetition of the situation with IE7 which, while having fixed bugs from IE6, broke pages that used the IE6-specific hacks to work around its non-compliance.

To avoid this situation, IE8 implemented a form of version targeting whereby a page could be authored to a specific version of a browser using the X-UA-Compatible declaration either as a meta element or in the HTTP headers.

To maintain backward compatibility, sites can opt into the IE7-like handling of content by inserting a specially created meta element into the web page that triggers compatibility mode in the browser.

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

A newer version of the browser than the page was coded for would emulate the behavior of the older version, so that the assumptions the page made about the browser’s behavior hold true.

Microsoft proposed that a page with a doctype that triggers standards mode (or almost standards mode) in IE7 would, by default, trigger IE7-like behavior, called “standards mode” (now called “strict mode”) in IE8 and future versions of IE. The new features of IE8 are enabled to trigger what Microsoft called the “IE8 standards mode” (now called “standards mode”). Doctypes that trigger quirks mode in IE7 will continue to do so in IE8.

The result for IE 8 Beta 1 was that it could render three modes: “Quirks,” “Strict,” and “Standard.” When there is an old DOCTYPE or when there is no DOCTYPE, IE renders it like IE5 would (quirks mode). When a special meta element or its corresponding HTTP header is included in a web page, IE8 will render that page like IE7 would (strict mode). Otherwise, IE8 renders pages with its engine (standard mode). Users can switch between the three modes with a few clicks. The release of Internet Explorer 8 Beta 1 revealed that many websites do not work in this new standards mode.

Starting with IE11, edge mode is the preferred document mode; it represents the highest support for modern standards available to the browser.

Starting with IE11, document modes are deprecated and should no longer be used, except on a temporary basis.

Use the HTML5 document type declaration to enable edge mode:
HTML

<!doctype html>

If you currently use the x-ua-compatible header to target a legacy document mode, it's possible your site won't reflect the best experience available with IE11.

If you have already added the X-UA-Compatible meta tag and it's not working as expected, there could be a couple of factors. See below for a list of common/known issues and their fixes.

Andrew here explains nicely why IE9 falls back to IE7 mode when running intranet websites and how to properly fix them

The X-UA-Compatible meta tag should appear immediately after the <head> tag.

Check and verify that your application or your webserver is not overriding the headers, because, headers have a higher priority that meta tags.

If your HTML markup has invalid content or errors, then websites will not be displayed properly in compatibility mode.

If you are using enterprise version then check the site list. A very detailed list of compatible versions can be found here

Add meta tags immediately after the <head> tag.

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

or

specify html5 doctype

<!doctype html>

or

Force your application or web server to serve with compatible headers. In case of a Ruby on Rails application, you can do the same by adding the following code to your application.rb

config.action_dispatch.default_headers = {
'X-UA-Compatible' => 'IE=Edge'
}

Note that, the HTTP headers have the highest precedence, followed by doctype followed by meta tags.

Hope this helps someone.

Using X-UA-Compatible to render websites in compatibility mode (2024)
Top Articles
Pulitzer And Tony Winning Play About A Mathematical Genius Crossword
Creed III - movie: where to watch streaming online
What Is Single Sign-on (SSO)? Meaning and How It Works? | Fortinet
Dunhams Treestands
Play FETCH GAMES for Free!
Victory Road Radical Red
Kreme Delite Menu
Metra Union Pacific West Schedule
Crocodile Tears - Quest
Kobold Beast Tribe Guide and Rewards
Computer Repair Tryon North Carolina
Big Y Digital Coupon App
41 annonces BMW Z3 occasion - ParuVendu.fr
Edgar And Herschel Trivia Questions
Iron Drop Cafe
Lesson 2 Homework 4.1
Capitulo 2B Answers Page 40
سریال رویای شیرین جوانی قسمت 338
Mbta Commuter Rail Lowell Line Schedule
Foxy Brown 2025
Craigslist List Albuquerque: Your Ultimate Guide to Buying, Selling, and Finding Everything - First Republic Craigslist
Rural King Credit Card Minimum Credit Score
Crawlers List Chicago
Skip The Games Fairbanks Alaska
Reptile Expo Fayetteville Nc
Melendez Imports Menu
Www.paystubportal.com/7-11 Login
Wkow Weather Radar
Southland Goldendoodles
1145 Barnett Drive
Klsports Complex Belmont Photos
Rek Funerals
Srjc.book Store
Osrs Important Letter
Gncc Live Timing And Scoring
Nikki Catsouras: The Tragic Story Behind The Face And Body Images
Lake Dunson Robertson Funeral Home Lagrange Georgia Obituary
Craigslist West Seneca
Google Chrome-webbrowser
Rochester Ny Missed Connections
Labyrinth enchantment | PoE Wiki
The Best Restaurants in Dublin - The MICHELIN Guide
Kornerstone Funeral Tulia
Best Restaurants Minocqua
Discover Things To Do In Lubbock
412Doctors
Breaking down the Stafford trade
Vagicaine Walgreens
John Wick: Kapitel 4 (2023)
Adams-Buggs Funeral Services Obituaries
tampa bay farm & garden - by owner "horses" - craigslist
Ark Silica Pearls Gfi
Latest Posts
Article information

Author: Nathanael Baumbach

Last Updated:

Views: 6109

Rating: 4.4 / 5 (75 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Nathanael Baumbach

Birthday: 1998-12-02

Address: Apt. 829 751 Glover View, West Orlando, IN 22436

Phone: +901025288581

Job: Internal IT Coordinator

Hobby: Gunsmithing, Motor sports, Flying, Skiing, Hooping, Lego building, Ice skating

Introduction: My name is Nathanael Baumbach, I am a fantastic, nice, victorious, brave, healthy, cute, glorious person who loves writing and wants to share my knowledge and understanding with you.