问题
In IE9, my webpage is displaying as Browser Mode: IE9 Compat View
and Document Mode: IE standards
, which is breaking all my canvas
es.
I have made sure to have <!DOCTYPE html>
as the very first line.
How can I force "normal" IE9 mode on IE9?
回答1:
There is the "edge" mode.
<html>
<head>
<title>My Web Page</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
</head>
<body>
<p>Content goes here.</p>
</body>
</html>
From the linked MSDN page:
Edge mode tells Windows Internet Explorer to display content in the highest mode available, which actually breaks the “lock-in” paradigm. With Internet Explorer 8, this is equivalent to IE8 mode. If a (hypothetical) future release of Internet Explorer supported a higher compatibility mode, pages set to Edge mode would appear in the highest mode supported by that version; however, those same pages would still appear in IE8 mode when viewed with Internet Explorer 8.
However, "edge" mode is not encouraged in production use:
It is recommended that Web developers restrict their use of Edge mode to test pages and other non-production uses because of the possible unexpected results of rendering page content in future versions of Windows Internet Explorer.
回答2:
The following line, taken from HTML5 boilerplate, did the job:
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
来源:https://stackoverflow.com/questions/10800290/ie9-force-ie9-browser-mode-and-document-mode