Let Internet Explorer 6 Behave Like Internet Explorer 7
Written by Stefan Vervoort on November 17, 2008
We all hate Internet Explorer 6 because the lack of support for CSS and the security issues it has. The browser is 7 year old and dated, but is still used by too many people.
Before we are finally ready to make our websites only work in the modern browsers, we have to deal with this problem. One solution could be the IE7.js JavaScript library.
What is the IE7.js JavaScript library?
IE7.js is a JavaScript library to make Internet Explorer 6 behave like Internet Explorer 7, a more modern browser. This library fixes many CSS and HTML issues developers are constantly trying to deal with.
What bugs does IE7.js fix?
Many CSS properties are supported by most modern browsers but not by IE6: IE7.js solve these problems. IE7.js also fixes many IE6 bugs that annoyed us from day one. Here are the most important ones:
CSS Selectors
- parent > child
- .multiple.classes
- :hover
- :first-child
- [attr]
- [attr="value"], [attr~="value"], [attr|="value"], [attr^="value"], [attr$="value"]
- [attr*="value"]
CSS
- Background-image – PNG alpha transparency (IE5.5+)
- Background-attachment – Support fixed positioning
- Position – Support fixed positioning
- Margin – Support auto (IE5.x)
- Cursor – Support pointer for IE5.x
- Display – Convert list-item to block for IE5.x
HTML
- img – PNG alpha transparency
- abbr – Bug fixed
How to implant this library to your website?
Yes I am sure you are. Next we will implant the library into your website. You can do that by adding this code between the <head></head> tags.
<!--[if lt IE 7]>
<script src="http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE7.js" type="text/javascript"></script>
<![endif]-->
It sounds to good to be true, right?
There is only one real disadvantage of this library. Like any other JavaScript script, it won’t work unless JavaScript is activated on the computer of the user.
The change exists that IE6 users have turned off JavaScript because of the security risks IE6 has. And if that’s the problem, IE7.js won’t work, and so won’t the features you have implanted.
With the result your website might not show correctly on these computers. So, you still have to make sure your website works in IE6 if Javascript is turned down and that doesn’t solve the whole IE6-hate-thing.
Further reading and links
If you want more information about this JavaScript library, be sure to visit the following links:
The IE8.js file
I decided to focus this article on IE7.js because that solves the most common bug fixes a normal developer would require and because Internet Explorer 8 is still in BETA. If you decide to use the IE8.js file instead of the IE7.js file, here’s how to do that:
<!--[if lt IE 8]>
<script src="http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE8.js" type="text/javascript"></script>
<![endif]-->
Note: You don’t need to include the IE7.js if you are using IE8.js.


Interesting, as I much prefered IE6 when I made the switch, but now I’ve been working with IE7 for a while – I could never go back.
[...] Let Internet Explorer 6 Behave Like Internet Explorer 7 [...]