At the top of all HTML documents, you will see the document type declaration written using the <!DOCTYPE > tag.

Here’s one example of an HTML5 document type declaration:

<!DOCTYPE html>
<html>
  <head>
    <!-- head content... -->
  </head>
  <body>
    <!-- body content... -->
  </body>
</html>

Technically, the <!DOCTYPE > tag is used to inform web browsers about the HTML version of the document.

This is required so that different web browsers can render the content correctly, especially during the beginning of the Internet.

Modern web browsers could parse HTML in two modes:

  • Quirks mode
  • Standard mode

The quirks mode is a set of techniques used by modern web browsers to parse legacy HTML documents designed for old web browsers that do not implement the W3C (World Wide Web Consortium) standards.

#html 

The HTML doctype tag explained
3.55 GEEK