Skip to content
shawnbot edited this page Jun 19, 2012 · 5 revisions

Working with MS Internet Explorer 8

IE8 is a popular, shitty browser that ships with the Windows OS. You will need to deal with it at some point. Here are some useful tips to help you cope.

Force IE8 into "standards mode"

First of all, be sure that you're using the HTML5 DTD-less DOCTYPE. Then, add this to your <head>:

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

You'll probably need this because, as @jasondavies astutely points out, some corporate (Windows) intranets have Internet Explorer configured enable quirks mode by default. This <meta> tag tells IE8 (and later versions), "No, really: use standards mode. I mean it."

Use aight

Standars mode will resolve most of the issues that you're likely to experience with styling, and even some JavaScript APIs. If you're doing anything even remotely sophisticated, though, you'll need to bust out aight. Grab the minified script and add the following to your document's <head>:

<!--[if lt IE 9]>
<script type="text/javascript" src="js/vendor/aight.min.js"></script>
<![endif]-->

This snippet wraps the inclusion of aight in IE conditional comments, which are invisible to modern browsers (because they appear as normal HTML comments), and become "visible" in IE only when the conditions in the block are met. In this case, we're only including aight if lt IE 9: when IE's version number is less than 9.

When all else fails, use Google Chrome Frame

Google Chrome Frame is an Internet Explorer plugin that runs Chrome inside IE. This is important because many corporate Windows intranets prohibit the installation of other browsers, which means that many of the people who need a good browser the most are not allowed to install it without administrator privileges. Chrome Frame works around this restriction, and is a good option for sites that require features that are simply unavailable (such as SVG) in older versions of IE.

Check out the getting started guide for instructions on setting up Chrome Frame. Remember, though, that there's nothing you can do to require users to install it. It's friendly and good practice to present IE users with a page that at least explains why it's necessary, and to ensure that the page is nicely formatted. You won't convince anyone to install it by simply triggering Google's ugly dialog then leaving them with a broken page if they dismiss it.