brettbrewer.com

Programming + Design

Home
Getting IE8 to behave like IE7 without user intervention PDF Print E-mail
Written by Brett Brewer   
Thursday, 20 March 2008

The Microsoft IE8 Beta was released recently and with it, a slew of new layout problems with sites that formerly worked on IE7. The interface looks similar enough to IE7 that I forgot I upgraded my laptop to IE8 Beta a couple of weeks ago. As a result I spent 4 hours debugging a navbar layout problem before I remembered I had upgraded to IE8 when I noticed the "Emulate IE7" button at the top of the window. I turned on IE7 emulation and suddenly everything started working properly again in IE. Fortunately Microsoft had the foresight to make this feature truly useful by letting content authors turn this feature on an off transparently using a meta tag in the page header. To get IE8 to render like IE7 simply add the following to the <head> section of your page: 

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

Voila! No new IE bugs to deal with today! I can hardly believe Microsoft did something this nice for web developers after all the years of obvious indifference. I've heard some ranting in the CSS community about this new meta tag being added just to satisfy IE, but honestly, who cares at this point. CSS is so stupid and broken it can't get any worse and if they want to give me a meta-tag to make dealing with this horrible technology easier then I'm 100% for it. In fact, I can think of about 10 other meta tags I'd like to add. I'd like one that would let me override both the standards-compliance and all browser hacks with one single browser hack that would make boxes properly resize themselves vertically to fit their contents. Or how about a simple way to get a bar to sit at the bottom or top of the screen without overlapping anything when the screen is resized. There's so many holes in the CSS specs and browser implementations of those specs that we are all lucky we can get even the simplest of layouts to look good on multiple browsers. Things have definitely gotten worse instead of better for web developers over the past few years. Microsoft is the primary cause of all of this, though the folks at Opera and Mozilla have done their fair share of crappy CSS rendering too. Hopefully with Microsoft's new policy of making IE8 work in standards-compliant mode by default will start a new trend, but I'm not optimistic. Let's not forget, we've been waiting for a way to easily make a 3-column layout with CSS for well over 7 years now without a single elegant solution from the CSS standards bodies or browser makers. Layout tricks that remain trivial to do with tables are STILL nearly impossible with CSS2. If you don't know what those things are, then you are lucky you haven't been using CSS for very long. This post is about a paragraph longer than it was supposed to be, but every time I get started talking about CSS it just turns into a rant. Sorry folks. Enjoy your new "standards-compliant" IE8 and the new meta tag...they are by far the best things to happen to a Microsoft browser in a loooooong time. 

Last Updated ( Thursday, 20 March 2008 )
 
< Prev   Next >

Search

Who's Online

We have 1 guest online

© 2017 www.brettbrewer.com
Joomla! is Free Software released under the GNU/GPL License.