javascript 强制 Internet Explorer 10 文档模式
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18983154/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Force Internet Explorer 10 Document Mode
提问by Wasif Kirmani
Basically I have been going through a problem and would like to enforce my browser to be used under Browser Mode: IE 10 Compatable View and Document Mode: Quirks.
基本上我遇到了一个问题,并希望强制我的浏览器在浏览器模式下使用:IE 10 兼容视图和文档模式:怪癖。
As in IE 10 Document Mode is IE 5 Quirks and only Quirks but, I am unable to enforce it by using document mode and meta-tag too.
正如在 IE 10 文档模式中是 IE 5 Quirks 并且只有 Quirks 但是,我也无法通过使用文档模式和元标记来强制执行它。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EDGE"/>
This is what I have been trying but no luck.
这是我一直在尝试但没有运气的方法。
回答by Praveen
You can try this, if the browser it IE10 the rendering machine will be changed to latest one.
你可以试试这个,如果浏览器是IE10,渲染机会改成最新的。
!-- Force IE to use the latest version of its rendering engine -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
chrome=1
means IE should use the Chrome rendering engineif installed
chrome=1
表示 IE 应使用Chrome 渲染引擎(如果已安装)
I think changing document type Quirks
seems a bad idea, however if you need then you may have to remove the !DOCTYPE
.
我认为更改文档类型Quirks
似乎是一个坏主意,但是如果需要,则可能必须删除!DOCTYPE
.
If none of these rules apply, the declaration determines whether the webpage renders in a standards mode, Almost Standards mode, or quirks mode.
如果这些规则都不适用,则声明将确定网页是以标准模式、几乎标准模式还是怪癖模式呈现。
Reference: http://msdn.microsoft.com/en-us/library/ff405803(v=vs.85).aspx
参考:http: //msdn.microsoft.com/en-us/library/ff405803(v=vs.85).aspx