Skip to content

33.Doctype? 严格模式与混杂模式-如何触发这两种模式,区分它们有何意义? #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
webVueBlog opened this issue Mar 14, 2020 · 2 comments
Labels
HTML&CSS HTML&CSS

Comments

@webVueBlog
Copy link
Member

No description provided.

@webVueBlog webVueBlog added the HTML&CSS HTML&CSS label Mar 14, 2020
@webVueBlog
Copy link
Member Author

声明位于文档中的最前面的位置,处于 标签之前。此标签可告知浏览器文档使用 哪种 HTMLXHTML 规范。

标准模式和混杂模式(quirks mode)。

在标准模式中,浏览器根据规范呈现页 面;在混杂模式中,页面以一种比较宽松的向后兼容的方式显示。混杂模式通常模拟 老式浏览器(比如 Microsoft IE 4Netscape Navigator 4)的行为以防止老站点 无法工作。

IE 6 出现时,在标准模式中使用的是正确的盒模型,在混杂模式中使用的则 是老式的专有盒模型。

为了维持对 IE 5 和更低版本的向后兼容性,Opera 7 和更高 版本也在混杂模式中使用有缺点的 IE 盒模型。

@webVueBlog
Copy link
Member Author

The declaration is at the top of the document, before the label. This tag tells the browser which HTML or XHTML specification to use for the document.

Quirks mode and standard mode.

In standard mode, the browser renders the page according to the specification. In hybrid mode, the page is displayed in a looser, backward-compatible manner. Hybrid mode typically mimics the behavior of older browsers (such as Microsoft Internet explorer 4 and Netscape Navigator 4) to prevent older sites from failing to work.

When IE 6 appeared, the correct box model was used in standard mode and the old proprietary box model was used in promiscuous mode.

To maintain backward compatibility with IE 5 and later versions, Opera 7 and later also use the flawed IE box model in hybrid mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HTML&CSS HTML&CSS
Projects
None yet
Development

No branches or pull requests

1 participant