Home > Web Front-end > HTML Tutorial > Browser's Standard Mode and Weird Mode_html/css_WEB-ITnose

Browser's Standard Mode and Weird Mode_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:34:45
Original
1611 people have browsed it

To write cross-browser CSS, you must know the two modes in which browsers parse CSS: strict mode and quirks mode.

The so-called standard mode means that the browser parses and executes the code according to W3C standards; the weird mode uses the browser's own way to parse and execute the code. Because different browsers parse and execute in different ways, we call it It's a weird mode. Whether the browser uses standard mode or weird mode when parsing is directly related to the DTD declaration in your web page. The DTD declaration defines the type of standard document (standard mode parsing) document type, which will cause the browser to load the web page and display it in the corresponding way. , ignoring the DTD declaration will cause the web page to enter quirks mode.

Chongqing PHP, the most professional PHP community

It will be parsed in a weird mode, that is, if your web page code contains a DTD declaration, the browser will parse it according to the standards you declared.

What is the difference between standard mode and weird mode? In standard mode

IE6 does not recognize the !important statement, but browsers such as IE7, IE8, Firefox, and Chrome do. In weird mode, IE6/7/8 do not recognize the !important statement. This is just a difference. One, and many other differences. So, to write cross-browser CSS, you must use standards mode. It seems too absolute, haha. Well, to write cross-browser CSS, you're better off using standards mode.


What are the statements? Which statement is better? We recommend that you use the strictest mode of XHTML 1.0. We should strictly demand ourselves from the beginning. The specific statement is as follows:

If you take over a legacy web page that does not initially have a DTD declaration and uses many tags that have been abolished in XHTML, then we recommend that you use XHTML compatibility mode, as declared below :

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template