IE9: Force IE9 browser mode and document mode

☆樱花仙子☆ 提交于 2019-12-10 18:48:56

问题


In IE9, my webpage is displaying as Browser Mode: IE9 Compat View and Document Mode: IE standards, which is breaking all my canvases.

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!