On earlier web pages, we can often see the following web page structure code:
<html>
<head>
<title>This is a web page</title>
<meta name=”…” content=”…” />
…
</head>
<body>
…
</body>
</html>
Obviously, the web page code with this structure does not comply with Web standards, but the browser can still render the web page well as long as there are no errors in the code. In fact, this is just like a page with a Table layout and a page with a Div structure. The browser can render it. The key is which page will render with higher quality.
There is a long distance between making a page and finishing a page.
In the development process of browsers, Microsoft has always become the dominant player in the browser market by bundling Internet Explorer into the Windows operating system. This has also resulted in a series of IE disregards of the Web standards established by the W3C organization. , Microsoft's IE has always only followed its own Web standards. Fortunately, Microsoft has decided to support Web standards in IE8, although this matter has not yet been finalized. In addition to Microsoft's IE, browsers such as Mozilla Firefox, Apple Safari, Opera, and Chrome have been fighting against IE for a long time in the name of supporting Web standards.
Different browsers result in different default parsing of HTML codes, so even the same code may appear in different styles under different browsers, so this requires a set of rules that all browsers follow. To coordinate the differences between browsers, this rule requires a declaration to reference it. This declaration is DOCTYPE - document type (document type).