Question

I have an ASP.NET site that is using Twitter Bootstrap, and everything looks great when I'm running locally, but when I deploy locally or to our test environment, all HTML5 elements seem to be ignored. I have a DOCTYPE that should allow me to use HTML5:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

How can I get this to work?

Was it helpful?

Solution

IE will, by default, check to see if a site is in your intranet, so that it can apply intranet security to your browsing. Another great feature is that it defaults the document compatability mode to IE7 for intranet sites - and IE7 isn't great at HTML5. You can see this if you hit F12 and pull up Developer Tools (Document Mode at the top).

So, the good news is, this is only an issue in intranet - once you deploy to your production server, you shouldn't encounter this issue anymore. The bad news is that proper testing is difficult while this behavior is in effect.

You can, of course, change your IE settings not to detect intranet sites automatically. However, for a more scalable solution, you can include this meta tag in your pages in order to force a higher compatability mode:

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

Reference in comments of this article.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top