Tuesday, October 04, 2011

Force Internet Explorer 8 Not To use “Quirks” Mode

I’ve been using the excellent BluePrint CSS framework for a new web application I’m developing. It does a great job and making the site look very good, and consistent, on almost all browsers except Internet Explorer (I know, huge surprise).

In my particular case I have users that are forced to use Internet Explorer 8.0 as their browser. With the configuration that’s set by default for them, Compatibility View is enabled because the University Enterprise Business software doesn’t display correclty on modern browsers or recent versions, meaning anything newer then Firefox 3.6 or Internet Explorer 6.0.

To compound the annoyance, Internet Explorer Compatibility View can’t be set for one particular site only, it assumes that all pages under the domain also need it and forces this as well with no option to only use or exclude a subdomain.

When Internet Explorer 8.0 uses Compatiblity View, it renders the webpage as Internet Explorer 7.0 and earlier would, also called “quirks” mode, which doesn’t display correctly with BluePrint CSS or other web-standard layouts. I found that I can add HTML code to force Internet Explorer not to use Compatibility View on my web application. Not using Compatibility View uses the newer rendering engine that does a slightly better job with the newer HTML standards.

To do this, add the following to your HTML header:

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

No comments: