25 Nov 2009

IE8 CSS Hack – Make IE8 work like IE7

ie8-betaAnother Internet Explorer, another set of problems.

As soon as we draw near to the close of having to support IE6, well for free anyway – this is a hotly debated topic you can read about here, we suddenly have to start learning the hacks for the latest IE, in this case 8.

Mostly this is related to CSS hacks as this is where i get the most stress an inconsistency, but not anymore, now i have found a wonderful way to force IE8 to render as IE7, so only one set of hacks to learn (which is useful as i am not aware of IE8 only CSS rules, without making an entire new file, something i object to).

Want to know what it is:

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

Something as simple as a meta tag. Stick in in your site header, and then sit back and smile.

For a while, you still have to make the site work in IE7, but we always have Browserlab for that

4 Comments so far

  1. Telmo Dias says:

    Interesting stuff!
    Didn’t know that was an option at all, I mean we have a button to toggle in between modes in the browser but I didn’t realize that we could select in the headers the IE8’s rendering engine.

    Though at first glance it is something I would be somewhat afraid to implement since we’ve all come to expect the worse of m$ browser development… If they for whatever reason strip emulation from browser 9 or 10 it could be proper hell to debug. I mean this sounds great for “quick fixing” websites which were made during in the IE7 reign, but as much as I would like it, I’m not too confident with using this for new projects.
    Also IE8 rendering and CSS support as it’s closer to what it should be and I rather code for that and then fix where fixing is required.

  2. mog says:

    You are correct, ..it is not an optimum solution, but this was written at the time when 8 was till in beta and everyone was battling with 6 and 7 conditional statements and hacks, ..and then along cam a new version that had no css hacks as such and still wasn’t playing ball, …so suddenly i could ensure everything that worked in 7 now worked in 8. Job done, ..no more hours lost to IE hell.

    As to going forward into the future, …and planning what MS will do next, ..well we all know from experience that common sense does not prevail, ..so we take it one step at a time.

  3. Telmo Dias says:

    Fair enough =)

    Just shooted my mouth off without much thought as I was genuinly surprised to know this was an option… And I so could have used that hint a year ago to cover up a css mess giving me time to mend the issue. I actually am really thankful for this tip, it’s something one could craftily use in a crunch.

    And I do share your pain, about debugging for IE… luckily version 8 adoption seems to be picking up and the big shots seem to be finally dropping support on version 6… as they should.

    Still at heart I want to believe m$ is slowly mending it’s ways for these past 2-3 years, slowly sure… but steadily. ( though I am a very gullible in nature :P )

  4. emma says:

    well explained, awesome post man

Leave a Comment

Inappropriate comments will be removed at admin's discretion.