Share via


Controlling default rendering

As discussed in Defining document compatibility, Windows Internet Explorer uses the <!DOCTYPE> directive to determine how to interpret and display a webpage. If a page doesn't contain a <!DOCTYPE> directive, Internet Explorer displays the page in quirks mode by default.

While this is true, it generally applies to webpages open in the Internet zone. Pages opened in the Intranet zone might be treated differently, depending on the configuration of the browser, the presence of group policy options, and other factors. We describe these factors and explain how you can control the default rendering of pages that do not contain <!DOCTYPE> directives.

Note  For best results, use <!DOCTYPE> directives in all webpages. This not only helps validate the webpage, it also ensures that the page works effectively in all browsers, devices, and experiences. For more info, see How to Enable Standards Support.

 

If the <!DOCTYPE> directive specifies a standards-based document type, Internet Explorer displays the page in standards mode. The HTML5 document type is a standards-based document type and is declared as shown in this example.

<!DOCTYPE html> 

If the <!DOCTYPE> directive is missing or doesn't specify a standards-based document type, Internet Explorer displays the page in quirks mode by default.

Be aware that certain conditions, like those listed here, can force Internet Explorer to display pages in a document compatibility mode different from the one specified in the webpage.

  • Compatibility View is enabled for the page.

  • The page is loaded in the Intranet zone and Internet Explorer is configured to use Compatibility View for pages loaded from the intranet.

  • The page is loaded from the user's local file system (which means the page is loaded in the Intranet zone) and Internet Explorer is configured to use Compatibility View for pages loaded from the intranet.

  • Internet Explorer is configured to display all websites in Compatibility View.

  • Internet Explorer is configured to use the Compatibility View List, which specifies a set of websites that are always displayed in Compatibility View.

  • The Developer Tools are used to override the settings specified in the webpage.

  • The webpage encountered a page layout error and Internet Explorer is configured to automatically recover from such errors by reopening the page in Compatibility View.

  • The page contains a Mark of the Web that directs it to be loaded in a particular zone.

These links provide additional info that describes how Internet Explorer determines the appropriate document mode for a webpage:

Note  When configured to load Intranet pages in Compatibility View, Internet Explorer makes an exception for pages loaded using the localhost address or a loopback address. Pages loaded using one of these techniques are displayed in standards mode when the <!DOCTYPE> directive specifies a standards-based document type.

 

In addition, Internet Explorer supports a feature control that allows you to control the way the browser handles webpages that don't contain X-UA-Compatible headers. For more info, see the Browser Emulation feature control.