Force Internet Explorer to use Compatibility View

For those of you looking for a quick answer, put this with the other meta tags in the <head> of your document:

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

The Reason

In previous versions of Internet Explorer, CSS standards weren’t respected as much as we would like it too. So, as a Microsoft Web Developer, we tend to favor Internet Explorer, since most client buying Microsoft solutions have their systems run a specific version of Internet Explorer. That’s why a lot of web sites and web applications were made for Internet Explorer 7. But as time goes by, later versions of Internet Explorer respected standards even more, to a point where web pages made for Internet Explorer 7 and earlier seem broken on Internet Explorer 8 and above. So this is a quick fix which tells Internet Explorer 8 and later to emulate the rendering engine of Internet Explorer 7. Though I agree this is a QUICK fix, it shouldn’t stay long in production code.

Best Practice

The best practice would be to revamp your web site to meet the new standards, and if you need to keep some specific code for IE7 and below, there are special comments which allows Internet Explorer to include code only for some versions. I don’t recommend to stay only with the meta tag for the following reasons:

  1. Because Microsoft, believe it or not, seems to go towards the standards of the web;
  2. Your website will seem broken in all other browsers, which, according to these stats as of October 2011, is 78.3% of the world.

Comments are closed.