我应该使用哪种X-UA兼容模式? [英] Which X-UA-Compatible mode should I be using?

查看:105
本文介绍了我应该使用哪种X-UA兼容模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在阅读使用文档兼容性元标记到网页的主题。

I have been reading around the subject of using document compatibility meta tag to web pages.

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8">

我有点困惑哪个内容值适合/用于xhtml过渡文档类型的共识,然后逐步转到HTML5 doctype。

I am a little confused which content value is appropriate/the consensus to use for a xhtml transitional doctype, and then progressively to HTML5 doctype.

我们仍然支持IE6,IE7,因此IE = EmulateIE8最适合。

We are still supporting IE6, IE7 so would IE=EmulateIE8 be the most suitable.

任何人都可以帮忙???

Can anyone help???

推荐答案

Rob说的话。支持各种IE与compat模式无关。 X-UA-Compatible标题简单地使IE浏览网站使用最新,最现代的布局引擎,如果你设置内容=IE =边缘IE9拥有所有IE 8,IE 7,IE 6,和怪癖模式支持。 IE10将支持IE9及以下作为渲染的相应引擎。因此,如果你设置content =IE = 6,这意味着特定的IE应该使用IE 6引擎来渲染网站 - 这完全违背了使用现代浏览器的目的。

What Rob said. Supporting various IEs has nothing to do with compat mode. The X-UA-Compatible header simply makes the IE the site is viewed on to use the latest, most modern layout engine that it has if you set content="IE=edge" IE9 has all IE 8, IE 7, IE 6, and quirks mode supported. IE10 will be supporting IE9 and below as respective engines to render on. So, if you set content="IE=6" it means that particular IE is supposed to use IE 6 engine to render the site - which completely defeats the purpose of using a modern browser.

在HTML5 Boilerplate中,我们还添加了chrome = 1,因此如果安装了Chrome Frame,该网站将利用这一点并呈现网站,就像在Chrome上呈现一样。

In HTML5 Boilerplate, we also add chrome=1 so if Chrome Frame is installed, that site will take advantage of that and render the site like it is rendering on Chrome.

这篇关于我应该使用哪种X-UA兼容模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆