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)

References

Top Articles
U.S.C. Title 4 - FLAG AND SEAL, SEAT OF GOVERNMENT, AND THE STATES
WeAreDevelopers World Congress 2023 – Sir Tim Berners-Lee, Erfinder des World Wide Web, eröffnet Entwickler Kongress in Berlin | Berlin Convention Office
2018 Jeep Wrangler Unlimited All New for sale - Portland, OR - craigslist
Dragon Age Inquisition War Table Operations and Missions Guide
Combat level
Activities and Experiments to Explore Photosynthesis in the Classroom - Project Learning Tree
Ribbit Woodbine
Chuckwagon racing 101: why it's OK to ask what a wheeler is | CBC News
Produzione mondiale di vino
Kagtwt
PGA of America leaving Palm Beach Gardens for Frisco, Texas
Purple Crip Strain Leafly
Willam Belli's Husband
라이키 유출
Arre St Wv Srj
Traveling Merchants Tack Diablo 4
Allentown Craigslist Heavy Equipment
Amazing deals for Abercrombie & Fitch Co. on Goodshop!
Reviews over Supersaver - Opiness - Spreekt uit ervaring
Trivago Myrtle Beach Hotels
Apparent assassination attempt | Suspect never had Trump in sight, did not get off shot: Officials
From This Corner - Chief Glen Brock: A Shawnee Thinker
Random Bibleizer
The Clapping Song Lyrics by Belle Stars
Stickley Furniture
Lesson 1.1 Practice B Geometry Answers
Mawal Gameroom Download
Why comparing against exchange rates from Google is wrong
Lininii
Mark Ronchetti Daughters
Housing Assistance Rental Assistance Program RAP
Σινεμά - Τι Ταινίες Παίζουν οι Κινηματογράφοι Σήμερα - Πρόγραμμα 2024 | iathens.gr
Where Do They Sell Menudo Near Me
Top-ranked Wisconsin beats Marquette in front of record volleyball crowd at Fiserv Forum. What we learned.
The Bold And The Beautiful Recaps Soap Central
Empire Visionworks The Crossings Clifton Park Photos
Admissions - New York Conservatory for Dramatic Arts
Cbs Fantasy Mlb
Sam's Club Gas Prices Florence Sc
Mugshots Journal Star
Callie Gullickson Eye Patches
'Guys, you're just gonna have to deal with it': Ja Rule on women dominating modern rap, the lyrics he's 'ashamed' of, Ashanti, and his long-awaited comeback
Lady Nagant Funko Pop
Ssc South Carolina
Europa Universalis 4: Army Composition Guide
Minecraft: Piglin Trade List (What Can You Get & How)
Craigslist Pet Phoenix
Gelato 47 Allbud
Tanger Outlets Sevierville Directory Map
Verilife Williamsport Reviews
Palmyra Authentic Mediterranean Cuisine مطعم أبو سمرة
Room For Easels And Canvas Crossword Clue
Latest Posts
Article information

Author: Virgilio Hermann JD

Last Updated:

Views: 5506

Rating: 4 / 5 (61 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Virgilio Hermann JD

Birthday: 1997-12-21

Address: 6946 Schoen Cove, Sipesshire, MO 55944

Phone: +3763365785260

Job: Accounting Engineer

Hobby: Web surfing, Rafting, Dowsing, Stand-up comedy, Ghost hunting, Swimming, Amateur radio

Introduction: My name is Virgilio Hermann JD, I am a fine, gifted, beautiful, encouraging, kind, talented, zealous person who loves writing and wants to share my knowledge and understanding with you.