Html5 Doctype Putting IE9 into Quirks Mode

HTML5 doctype putting IE9 into quirks mode?

Placing:

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

in the <head> tag should do it.

IE9 throwing site to Quirks mode

If the page is local, or on an Intranet , Internet Explorer defaults to quirks mode.

If you put the same page on The Web, it would behave as expected.

To get it working as you want, as you are using ASP.NET, you can add this to your web.config file:

<system.webServer>
<httpProtocol>
<customHeaders>
<clear />
<add name="X-UA-Compatible" value="IE=edge" />
</customHeaders>
</httpProtocol>

This avoids having to override the user settings for all Intranet pages.

IE and HTML5 doctype issues

IE does not go into quirks mode with that doctype. The boilerplate should be fixing IE problems, not causing them. You are missing the <html> element after the doctype. Add that to see if things change. HTML5 does not require it but, if missing, either IE or boilerplate may go crazy according to the docs.

Also, just remove the comments after the doctype and that should make the problem go away.

Why is the site running in IE quirks mode?

Sample Image

It's a Byte Order Mark, , which is invisible to most text editors. Try using VIM and killing it or somehow find a different text editor and kill everything before <!DOCTYPE html>

You can simply copy <!DOCTYPE HTML> and everything below it into a new file and save over it, meaning you wont be copying the BOM coming before it to resolve this issue; I've ran into it many times.



Related Topics



Leave a reply



Submit