Custom Web Designs by Bay Web Design Firm MJS Web Solutions Building Websites That Can Be Found Contact Us | Our Company | Home
510.523.7312
MJS Web Solutions Blog
Thoughts :: Opinions :: Trends

Tuesday, May 12, 2009
CSS Compatibility Mode Fix for Internet Explorer 8

ie8My recent post about IE8 has launched it’s ugly head.

A client of ours contacted us to let us know after they downloaded the new Internet Explorer 8 there site looked messed up.

Knowing this was going to be a problem, Microsoft created a button called ‘Compatibility View‘ so users could view websites in the older version of their browser.

But this was not a work around for our client.

Instead of fixing (or hacking) all the code on the website I added the following code recommended by Microsoft:

<html>
<head>
<!-- Mimic Internet Explorer 7 -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" >
<title>My Web Page</title>
</head>
<body>
<p>Content goes here.</p>
</body>
</html>

It worked!

This is truly a work around – a Microsoft work around. Microsoft knew full well that their new browser couldn’t view perfectly good standard coded websites, so they had to come up with a way to view websites as if you were using their old browser.

What a joke. It’s no wonder why Microsoft is losing market share to Firefox and Apple.

Posted by: Michael Swartz at 6:23 pm

Comments: 35 Comments | Filed under: HTML, Web Design

35 Comments Add your own

  1. Mike says:

    Ya baby!! You are the man! I’m having the same issue with my clients site and you solved my problem with a 2 second google search.

    Thank you!!

    Posted on: June 3rd, 2009 at 11:25 am
  2. Excellent!

    Glad to hear the code helped you out. I knew others would have the same issue.

    Thanks for letting me know you found my post via a Google search. I titled my post hoping people would find it easily. I initially had to do some deep searching on MSDN to find this fix.

    Posted on: June 3rd, 2009 at 11:36 am
  3. sourabh says:

    website looks bad in ie7 and other browser but look ok in ie6 so help me out…

    Posted on: June 9th, 2009 at 3:45 am
  4. Hi Sourabh. Your website looks fine in IE7 over here.

    Posted on: June 9th, 2009 at 8:39 am
  5. Cole says:

    Thanks for writing this article Michael, I’d had the same problem on my site, although visibly it looked fine in IE8.
    It’s a shame that Microsoft insist on new technologies that make everyone else look bad.
    After browsing around I found facebook were using the same work around.

    Posted on: June 19th, 2009 at 8:12 pm
  6. Hi Cole.

    You’re welcome. I’m glad you found the article helpful. I knew there would be others who would need this information. Amazing how Microsoft buried this ‘hack’.

    Interesting about Facebook.

    Thanks for you comments.

    Posted on: June 22nd, 2009 at 8:43 am
  7. Had the same problem on my site. After a few unsucessful attempts to fix the problem, I googled the fix and came across this article. The fix works great. Thanks

    Posted on: July 16th, 2009 at 6:43 am
  8. Thanks! This way I have solved a GoogleMaps Pedometer problem at Camburi.tv

    Posted on: July 19th, 2009 at 9:24 am
  9. Hi David and Markus.

    You’re welcome. I’m glad to hear this corrected your issues.

    Posted on: July 22nd, 2009 at 3:56 pm
  10. Chris Washington says:

    Okay… this doesnt seem to work for me… not quite sure why… I added the code and all it did was take away the compatability icon away at the top of the page, but it still looks the same… It looks great on all other major browsers (Firefox, Safari, Chrome, and Opera )… However when I hit the compatability view icon it works perfectly… why the difference in behavior

    Posted on: July 26th, 2009 at 10:07 am
  11. Hi Chris.

    Not sure why it’s not working for you. I know it takes away the compatibility icon, but it should also emulate IE7. Please list your URL and maybe I can take a look at it.

    Posted on: July 28th, 2009 at 9:03 am
  12. Jim says:

    Thanks – saved me a bunch of time. Too bad microsoft can’t is so fouled up that this stuff has to happen

    Posted on: August 26th, 2009 at 8:50 am
  13. Gustavo says:

    Thanks a lot!!!! I’ve been struggling with this all day.. this worked awesome.. I can go to sleep now…

    Thanks again!

    Posted on: September 1st, 2009 at 5:11 pm
  14. Jacob says:

    Thanks for the foot work Michael. I wish Microsoft would get it together with their browser. I personally stopped using IE a long time ago, however when developing websites you have to develop for the masses. The masses still use IE.

    Posted on: September 16th, 2009 at 3:23 pm
  15. chris says:

    I my god. What a post. You are so wrong about this part:

    “Microsoft knew full well that their new browser couldn’t view perfectly good standard coded websites”

    Internet Explorer 8 is much better with good standard coded websites. You’re code is just s*** and not standard at all. My sites works perfectly in IE8 with good standard codes, only ie7 and ie6 needed some fixes.

    Posted on: September 17th, 2009 at 10:35 am
  16. Chris. I was talking about IE7, not IE8. I agree IE8 is better, but Microsoft built IE8 with compatibility mode because they knew websites would look and act differently.

    Posted on: September 17th, 2009 at 2:30 pm
  17. Jay says:

    Actually you’ve developed your site for IE7, using some of the non-compatible css features. IE8 doesn’t support all of IE7′s non-compatible features.

    Posted on: November 5th, 2009 at 7:29 pm
  18. Jesus says:

    Hey Michael!!! thank you so much for informing us all!! this really helped me as I was checking my website in all popular browsers and noticed explorer was displaying my content differently but in compatibility mode it was great! thank you for the code! it took me 1min at the most to find your post! =D thanks!!

    Posted on: December 15th, 2009 at 4:09 am
  19. Tony says:

    This seems to be a great fix for most but it doesn’t work for forum posts. On my forum, whenever I (and some members) try to write a long post, the screen bounces back up and it’s impossible to see what you’re typing

    Posted on: December 25th, 2009 at 7:31 pm
  20. Karlsse says:

    i am a firefox user more than an internet explorer user but it seems that Internet explorer 8 is very stable and it its loading time for webpages is faster too.

    Posted on: February 5th, 2010 at 9:02 am
  21. Adrian says:

    Michael, great tip – thanks for sharing.

    This definitely works better than IE8 Compatibility mode when testing IE7 specific css hacks (e.g. html>body).

    Posted on: June 18th, 2010 at 2:07 am
  22. Nick says:

    Thanks, worked a treat.

    Posted on: July 1st, 2010 at 5:39 pm
  23. @Adrian @Nick You’re very welcome. I’m glad to hear the solution helped.

    Posted on: July 2nd, 2010 at 8:27 am
  24. Mamoj says:

    You are the man Michael, you have solved my problem. Thanks very much.

    Posted on: October 12th, 2010 at 12:43 am
  25. Robbye says:

    Ok it has been a while since you posted this.
    I seem to be having severe problems with IE8 and compatibility mode. I have tried all of the meta tags available and still no hope of solving the problem.
    The last thing that I did was set the X-UA-Compatible to IE=8;FF=3;OtherUA=4
    so far that has been the best, but I have a .NET UpdatePanel and some buttons that trigger AsyncPostBacks that cause my CSS to go all goofy at random.
    Is there a way to force the browser to no use the compatibility mode button?

    Posted on: October 15th, 2010 at 6:17 am
  26. @Robbye I’m not sure. You may want to do a search on Google for ‘compatibility mode remove’

    Posted on: October 15th, 2010 at 12:02 pm
  27. Bryan says:

    I know this post is reaching almost 2 yrs old, but it help me out drastically. Worked for nearly a day on the CSS file due to the IE rendering and the meta tag that you have posted did the trick. I just finished looking at a MS blog (before clicking onto your page) and it didn’t lay the meta tag out very clearly like you did.

    Thank you so much.

    Posted on: February 6th, 2011 at 1:21 pm
  28. You’re very welcome Bryan and thank you for visiting.

    Posted on: February 7th, 2011 at 9:47 am
  29. ThemeKings says:

    Thanks for sharing. Nice piece of information!!!

    Posted on: February 15th, 2011 at 10:31 am
  30. waizen says:

    Thank you for this. It saved me today. However, expanding on this, according to the MS site, you can set the code to call the latest version of IE by changing the code to:

    Notice the word ‘edge’. That makes the code call the latest and greatest version of IE you have on hand.

    I do have another question, though: does that meta code snippet completely replace a standards compliant one like:

    If it does, it will seem to corrupt the benefits of the second one. Also, it seems that the code shuts down the use of compatibility mode in the browser. Sometimes it comes back on its own on the next site visited, sometimes not.

    Not a perfect system.

    Posted on: March 30th, 2011 at 6:42 am
  31. waizen says:

    I noticed your system filtered out my code.

    Just replace the IE=EmulateIE7 part with the word edge.

    Posted on: March 30th, 2011 at 6:43 am
  32. waizen says:

    Sorry, again: just replace the EmulateIE7 part with edge. What a morning.

    Posted on: March 30th, 2011 at 7:20 am
  33. shruti says:

    thanks michael, it saved lots of hard work..

    Posted on: July 1st, 2011 at 12:06 am
  34. Ramesh says:

    Thanks for this.This will help us lot.

    Posted on: October 27th, 2011 at 8:00 am
  35. Nick Albert Calib-og says:

    I haven’t tried it yet. One problem Ive encounter in css/ie is the nth-child thing.. hope this is really a workaround for this..

    Posted on: February 26th, 2012 at 11:40 pm

Leave a Comment

Required
Required, hidden
Comment moderation is in use. Please do not submit your comment twice -- it will appear shortly.

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Site Map
Alameda Chamber of Commerce Member
West Alameda Business Association Member (WABA)
© Copyright 2012 MJS Web Solutions Blog. All rights reserved.
Powered by Westhost and WordPress.
Log in