Forcing IE7 display in IE8 (updated)

I have been developing for IE8 since it was first released. Although they say it’s a final build, it’s actually in a late beta stage. There are several key CSS commands that haven’t been completed yet (such as :first-letter) and some calculations that still aren’t right in the browser. This is why they built the compatibility mode into it. This creates a major issue for web developers because any conditional statements for IE8 that are put in will break the page once it is fixed. I have thought about every possible fix and the only reasonable solution that I’ve found is… kill it!

Upon scraping the web for possible solutions I came across this gem:

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

Enter this into the head of your page and it forces IE8 into IE7 mode. In case you didn’t know, compatibility mode is a full fledged version of IE7. It even recognizes conditional statements for IE7.

The next step is to have a browser sniff for the exact version that will fix the current IE8 bugs and will only load the meta tag if it’s an older version of IE8. Who knows when Microsoft will get it together enough to fix IE8…I still can’t believe they released a beta version as a final build. I guess nothing coming from them surprises me anymore. Oh well… life goes on (and so does the work)!

Update:

I have recently discovered a few things about this that you need to know. First, in Joomla! you must put it above jdoc:include type=”head” to get it to work. Secondly, it actually makes your browser into an IE7 browser with no compatibility mode button. All conditionals are unfortunately kept at IE8 though which creates some issues. You will have to make new conditional statements for IE8, but you can easily tag them onto your old conditionals using if lte IE 8. My solution is to kick IE8 into IE7 mode and just deal with it.

The Core Team
Editorial Staff Members at 'corePHP'
Editorial staff for the Core Technology Blog for 'corePHP' - news, views insights and advice for e-commerce, marketing technology , web design and development.

6 thoughts on “Forcing IE7 display in IE8 (updated)

  1. Dennis

    Yeah I’m actually having problems with IE8. I use Mac and FireFox as my browser, however, people that uses Windows and IE8 are having problems rendering the page.

    1. Steven PignataroSteven Pignataro

      Denis,

      What type of problems are you having – have you used the above code to see if it resolves your issues?

      Kindest regards,
      –Steven Pignataro
      CEO ‘corePHP’

    1. Jonathan Shroyer

      Is it working in IE7? The code will make it emulate IE7, so if it isn’t working in IE7 then you have to fix it for that browser. If you need help we take a look and troubleshoot it for you. Let us know and we will open a job ticket for you.

  2. dan R

    Okay, so I get the idea here but what I don’t know is how to add the code. Do I put this in index.html? If so, do I put it in all instances of index.html? I’m very new to design and know very veeeerrry little about html. WYSIWYG is my friend.

    1. jshroyer

      Yes, it goes into the head of the index.html file. If you are making a static site then it has to go into every html file. If you are using Joomla! then it goes into the head of your index.php file in the template folder. Unfortunately, you need to be at least a little familiar with HTML to safely mess with this.

Comments are closed.