0

I have this web page that begins with <!-- DOCTYPE html -->, which I believe would suffice to indicate HTML 5 and make IE9 interpret it as "IE9 standards". However, when I navigate to it, IE9 shows it as "Browser mode: IE9 Compat View", "Document mode: IE7 standards".

The two first lines in the page are:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

As a result, some of the layout is rendered incorrectly. For example, a right-aligned table cell shows left-aligned. If I manually set IE to "Browser mode: IE9", "Document mode: IE9 standards", then things look perfect. Other browsers work fine.

What do I need to change in order to make IE9 recognise HTML 5 and prevent it from working in compatibility mode? Thanks.

CesarGon
  • 14,525
  • 6
  • 53
  • 81
  • 2
    have you tried it without the `xmlns`? – ultranaut Oct 06 '12 at 00:52
  • are you running over an intranet? if so check out http://stackoverflow.com/questions/2518256/override-intranet-compatibility-mode-ie8 and http://stackoverflow.com/questions/2742853/force-internet-explorer-8-browser-mode-in-intranet – johlrich Oct 06 '12 at 00:54

1 Answers1

2

Two things I do:

<!doctype html>

and

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

And take out the XMLNS

Using: http://msdn.microsoft.com/en-us/library/cc288325(v=vs.85).aspx

Omar Mir
  • 1,378
  • 1
  • 17
  • 35
  • Thanks for the tips. This has fixed "Document mode", which now appears as IE9, but "Browser mode" is still "IE9 Compat View". Any ideas? – CesarGon Oct 09 '12 at 06:53
  • Hi @CesarGon I don't think Its of importance for the Users. See here: http://superuser.com/questions/321403/how-to-change-browser-mode-in-ie9-permanently I haven't tested all this myself so maybe walk over to another computer and try it where you haven't enabled developer mode. – Omar Mir Oct 09 '12 at 12:57
  • For people not wanting to click: I don't think you can really affect the browser mode setting; this seems to be a developer debugging feature. If a user is running IE9, the browser mode will be IE9 or IE9 Compatibility View. You can affect the compatibility view setting by using the X-UA-Compatible tag or HTTP header (though, watch out for the Tools -> Compatibility View settings - > "Display Intranet sites in Compatibility View" setting). – Omar Mir Oct 09 '12 at 12:58