HTML5文档类型将 IE9置于怪异模式?

我试图让 IE9加载我的网页与 IE9标准..。

我注意到有 <!DOCTYPE HTML>把该死的东西进入怪异模式... 这几乎打破了页面上的一切..。

如何让 IE 遵守 IE9标准?

86921 次浏览

Placing:

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

in the <head> tag should do it.

Make sure you don't have any HTML comments before the DOCTYPE declaration otherwise it will trigger IE9 to use quirks mode.

Just having <!DOCTYPE html> at the very top of the page with nothing preceding it should be enough to make IE9 use standards mode. You shouldn't need the meta tag as well.

Using the WebBrowser control to display HTML will use IE8 rendering, regardless of doctype, unless you specify

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

or

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

Remove any unsupported comments, check for ie supported comments. And place in your head tag. The doc type declaration should be the very 1st line in your HTML.

I have in the head mentioned in all the pages. However it is just showing correctly for the home page for all other pages the page is still rendered in scattered mode.