本文介绍了IE8和怪异模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

IE8是否像IE6 / 7那样以怪异模式运行?

Does IE8 run in quirks mode like IE6/7?

我有一个网页,有一些真正的奇怪的代码。内容以填充和负边距为中心。

I have a webpage that has some truly bizarre code. The content is centered with padding and negative margins.

它在IE6 / 7和其他浏览器中正常工作,但在IE8中,内容区域宽一半,不居中(奇异模式的标志)。

It works correctly in IE6/7 and other browsers but in IE8 the content area is half as wide and not centered (flag for quirks mode).

源代码在DOCTYPE之前有三个空行。我知道,会抛出IE6进怪癖模式。它会影响IE8吗?

The source code has three blank lines before the DOCTYPE. I know that will throw IE6 into quirks mode. Will it also affect IE8?

我没有访问源,所以我不能删除这些行来测试它。

I don't have access to the source so I cannot remove those lines to test it.

推荐答案

执行一些快速测试,可在似乎表明空白行不应该将IE8转换为Quirks模式(这与所有人似乎都感到困惑的兼容模式不同)。

Running a few quick tests that can be found here seem to indicate that blank lines shouldn't throw IE8 into Quirks Mode (which is different to Compatability Mode that everyone seems to be confusing it with).

我写了一份关于如何令人难以置信的混淆IE8 / 7的不同模式的分类,我甚至没有包括怪异模式在细目。有关怪癖模式的详细说明,请访问(不是原始问题,而是其他人可能会觉得很有趣。)

I wrote a breakdown on how incredibly confusing the different modes of IE8/7 here and I didn't even include Quirks Mode in the breakdown. A detailed description of Quirks mode can be found here (not for the original question, but others might find it interesting.)

这篇关于IE8和怪异模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 18:22