Developer’s Dilemma: Document Compatibility in IE
As a developer, when we test our website in Internet Explorer, we sometimes found that it is displaying in a different way than it was in other browsers like firefox or chrome.
The answer lies in the IE’s backward compatibility with older websites and early version of the browser.
All versions of Internet Explorer released after Internet Explorer 6 support up to three document modes and we usually handle these two modes:
- Standards mode provides the greatest support for the industry standards, such as HTML5, CSS3, SVG, and others.Then, why not take advantage of this enhanced support, This is the preferred mode for new public websites.
- Quirks mode displayed pages as if they were viewed with older versions of the browser. Why? because it emphasizes compatibility over standards compliance by supporting behavior found in earlier versions of Internet Explorer.
How application manages to keep a track of modes?
DOCTYPE> defines the document type of a webpage, which in turn determines how the page is displayed to the end-user. For example,to specify the HTML5 document type.
For earlier version of Internet Explorer, we can use the “x-ua-compatible” header, For example:
<meta http-equiv="x-ua-compatible" content="IE=9">
In IE 9 and earlier versions, quirks mode restricted the webpage to the features supported by Microsoft Internet Explorer 5.5.
In IE 10, quirks mode conforms to the differences specified in the HTML5 specification.
The following table shows the document modes that each version of Internet Explorer supports.