Why just write HTML5 <! DOCTYPE HTML>?

HTML4.01 the doctype DTD needs to be quoted because HTML4.01 based on SGML. And HTML5 is not based on SGML, and therefore does not need to be referenced DTD, doctype but need to regulate the behavior of the browser. Which, SGML is the Standard Generalized Markup Language, simply put, is more than XML, HTML older standard, both of which are by the SGML evolved.

However, HTML5 is not.

<DOCTYPE> declaration in the first line of the HTML document, in the <html> tag before.

The main role is: tell the browser what standard parser to parse this document. DOCTYPE does not exist or is not formatted correctly will result in a document presented in quirks mode.

Guess you like

Origin www.cnblogs.com/luoluo-snow/p/11504415.html