【发布时间】:2014-12-08 10:14:45
【问题描述】:
我最近参加了几门在线课程,但我仍然看到一些讲师默认将以下元标记添加到他们的文档顶部:
<meta http-equiv="X-UA-Compatible" content="IE=edge">
人们的想法似乎是这与<meta charset="UTF-8"> 一样重要和有用。
但是为什么呢?
根据Microsoft's Modern.ie documentation,这是“确保 Internet Explorer 使用最新引擎”的“最佳实践”。好的,很公平。
但是,如果您关注the flow diagram on MSDN,它清楚地表明没有X-UA-Compatible 信息的文档将被转发到用户的“兼容性视图”首选项和if that's not set then just follow the !DOCTYPE declaration。
换句话说,除非用户有一些兼容性视图设置,IE will just follow your !DOCTYPE and use the latest standards mode of your browser for rendering anyway...根本不需要X-UA-Compatible IE=Edge 声明。
正如 MSDN 所说:“Use the HTML5 document type declaration to enable edge mode”。
那么在什么情况下需要X-UA-Compatible IE=Edge?
【问题讨论】:
标签: internet-explorer x-ua-compatible