Because it is not an HTML tag, it is just a browser command that tells the browser the version of the tag used to compile the page, so it does not need to appear in pairs when we open the source code of a regular website, the source code must startSome later directly add> while others have long text, such
Of course, the mainstream web page source code, such as E-dimensional technology source code uses HTML5 format, directly.Because it is not an HTML tag, it is just a browser command that tells the browser the version of the tag used to compile the page, so it does not need to appear in pairs.It is not case sensitive in any version, but is used to writing"", Of course, to comply with W3C standards, write".
E-dimension technology homepage Source Code adopts HTML5 Declaration + HTML4 compatibility
DOCTYPE indicates the document type, that is, the HTML Version type declaration. Since the beginning, HTML has not gone through any of the more popular HTML4 standards, and then enters the HTML5 era. The standards in each period are different. For example, HTML in earlier versions cannot be implemented.
Line feed. This is because HTML tags must appear in pairs, so you must use
. In the later stages of HTML4, the concept was very vague, with no "/" at the end. In HTML 5, "/" is not required.
You can.
In this case, you need to tell the browser the version specification used for HTMl encoding on the current webpage.
It is very important to specify DOCTYPE in all HTML documents so that the browser can understand the expected document type.
The DOCTYPE in HTML 4.01 needs to reference the DTD, because HTML 4.01 is based on SGML. HTML 5 is not based on SGML, so you do not need to reference DTD, but you need doctype to regulate browser behavior (let the browser run as they should .).
HTML Version Declaration
HTML 5 does not have any document types, but it is best to avoid using the frame framework. XHTML 1.0 specifies three XML document types: Strict, Transitional, and Frameset. HTML 4.01 specifies three document types: strict, Transitional, and Frameset.
HTML 5 specification Declaration
The expression is concise, with only one attribute: the root element is html
XHTML 1.0 Strict DTD
Use this type if you need a clean flag to avoid confusion on the presentation layer. Please use it with the stacked style sheet (CSS:
In the preceding Declaration, the root element of the document is html, it is defined in the DTD where the public identifier is defined as "-// W3C // dtd xhtml 1.0 Strict/EN. The browser will understand how to find a DTD that matches this public identifier. If not, the browser uses the URL following the public identifier as the location for searching for the DTD.
XHTML 1.0 Transitional DTD Transitional Edition
Transitional DTD can contain the rendering attributes and elements that W3C expects to move into the style sheet. If your readers use browsers that do not support Cascading Style Sheets (CSS) and you have to use the XHTML rendering feature, use this type:
XHTML 1.0 Frameset DTD framework Edition
Use this DTD when you want to use the framework!
HTML4.1 Transitional DTD Transitional version
Transitional DTD can contain the rendering attributes and elements that W3C expects to move into the style sheet. If you use a browser that does not support Cascading Style Sheets (CSS), you must use the HTML Rendering feature:
HTML4.1 Strict DTD Edition
Use this type if you need a clean flag to avoid confusion on the presentation layer. Please use it with the stacked style sheet (CSS:
HTML 4.01 Frameset DTD Framework Document
Frameset DTD should be used for documents with frameworks. Except that the frameset element replaces the body element, the Frameset DTD is equivalent to the Transitional DTD: