强制 Internet Explorer 9 使用标准文档模式 [英] Forcing Internet Explorer 9 to use standards document mode
问题描述
如何强制 Internet Explorer 9 使用标准文档模式?我建立了一个网站,我发现 IE9 使用 quirks 模式来呈现网站页面.但是我想使用标准模式进行渲染.
How can I force Internet Explorer 9 to use standards document mode? I built a website and I'm finding that IE9 uses quirks mode to render the website pages. But I want to use standards mode for rendering.
推荐答案
<!doctype html>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
这使得每个版本的 IE 都使用其标准模式,因此 IE 9 将使用 IE 9 标准模式.(如果您希望较新版本的 IE 也 专门使用 IE 9 标准模式,您可以将 Edge
替换为 9
.但这很困难看看你为什么想要那个.)
This makes each version of IE use its standard mode, so IE 9 will use IE 9 standards mode. (If instead you wanted newer versions of IE to also specifically use IE 9 standards mode, you would replace Edge
by 9
. But it is difficult to see why you would want that.)
有关说明,请参阅 http://hsivonen.iki.fi/doctype/#ie8(看起来很乱,但那是因为 IE 的行为很乱).
For explanations, see http://hsivonen.iki.fi/doctype/#ie8 (it looks rather messy, but that’s because IE is messy in its behaviors).
这篇关于强制 Internet Explorer 9 使用标准文档模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!