Order DOES matter when it comes to EmulateIE7!

So, here's the story in a nutshell:

IE8 breaks some pages that were made with Visual Studio. Specifically, GridView headers won't align themselves left or right, even though you set the option. Bringing IE8 into compatibility mode fixes the problem. Microsoft implemented a meta tag that allows you to bring down IE8 into compatibility mode from the page itself.

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

The only problem is that the tag doesn't work; or so I thought! In their document about the subject, Defining Document Compatibility, Microsoft explains, "[The meta tag] must appear in the Web page's header…before all other elements, except for the title element and other meta elements."

My bad. I put the tag at the bottom of the header because I assumed that the order didn't matter. Silly me.

After putting the tag in the right place, my document displays just fine in IE8, and even removes the compatibility-broken-page-button to boot!

Leave a Reply

Your email address will not be published.