internet-explorer-7 - 为什么 ie7 总是处于 Quirks 模式?

标签 internet-explorer-7 doctype

这是我正在使用的 DOCTYPE 和 XML 声明:

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

但是 IE7 总是会进入怪癖模式......

有谁知道为什么?

提前致谢!

最佳答案

如果您在 DOCTYPE 之前除了 XML prolog 之外还有任何东西,那么您将在 IE7 中触发 quirks 模式。这包括空格和注释。

The XML prolog will only trigger quirks mode in IE6.

关于internet-explorer-7 - 为什么 ie7 总是处于 Quirks 模式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3527297/

相关文章:

PHP DOM : change doctype of existing DOMDocument

html - IE7 的 z-index 错误,一个复杂的案例

internet-explorer-7 - IE7 的预期支持终止是什么?

html - 背景 CSS 图像仅在 IE7 中不显示

html - 定位元素在 MSIE7 流中的下一个定位元素下消失

CSS:IE7 需要的帮助

html - Doctype 声明 Internet Explorer 错误

asp.net - 如何在不访问代码的情况下将文档类型更改为标准模式?

html - 什么是 DOCTYPE?

c# - 如何在 C# 中将文档类型添加到新的 XML 文件