November 16, 2009

Stop wasting time debugging on IE8 when you don't have to!, or, get IE8 to behave like IE7

ie8-betaYeah, sure, I’d love to see all IE6 users stop using their browsers too, but that’s not what I’m proposing here for IE8 users.

IE8 is a huge improvement in comparison to browsers of the past. Unfortunately, it’s still another browser that we web developers have to perform a cross browser check.

What’s even more frustrating is that IE8 comes with a “compatibility mode,” where users can force IE8 to render code as if it were IE7. This is of course to “make up” for developers who didn’t check their code in IE8.

WTF would Microsoft ship a new browser, with the option to have it act like an older browser? Makes no sense to me; however, I WILL take advantage of this fact to save me time in producing a web site.

Just stick this meta tag RIGHT BELOW the opening head tag. Anywhere else and it’s libel not to work.

  1.  
  2. <html>
  3.   <head>
  4.   <meta http-equiv="X-UA-Compatible" content="IE=7" />
  5.   <title>Awesome webshite</title>
  6. </head></html>

And that’s it! If you were having issues in IE8 but NOT IE7 – have issues no more. This meta tag forces compatibility mode to be “on” for whoever browses this site using IE8, and renders the code as if it were IE7. If it’s working, you should not be able to click on the torn page icon for compatibility mode on the right of the url bar.

Correct:

Picture-2

Incorrect:

Picture 1

So now, all you gotta do is make sure your code is Kosher with IE7 – if that’s true, then just stick this meta tag in and not worry about IE8!

Note to Microsoft: Just adopt webkit already! Let me use my rounded corners in your market share majority browser damnit! I’m sick of all this alpha filter crap! If you can do that for IE9, I’ll stop ignoring IE8 developments completely.

RSS feed for comments on this post.

  1. Pad — November 17, 2009 @ 12:38 am

    Cheers for this hint mate, just been having a mare with a layout because IE 8 is shite.

    This new tag is my gospel.

  2. sankho — November 17, 2009 @ 8:26 am

    Thanks for the comment Pad. For my next post, I’ll show you the Meta tag that destroys IE6 completely! Wouldn’t that be a treat?

  3. richard — March 9, 2010 @ 12:30 pm

    Great article thanks! Now I only have to worry about version 6 and 7 of IE…

Leave a comment

Best of Blog

  1. Let’s do the kids a favor: HTML as a classroom language
  2. USTORE.js – cross browser local and session storage
  3. Add Facebook Connect to your PHP Web App
  4. Setting up your website on Rackspace Cloud Servers – Manage Your Own Hosting
  5. Tutorial: Using Zend_Captcha_Image

Search if you must