The role of DOCTYPE in HTML is to explain at first glance to programmers and browsers what document type definition (DTD) it is and how a website should be rendered. The DTD indicates which code language is used on the page or in the HTML document. This applies for example to files in HTML, XHTML, SVG, MathML or XML. If you want to create your own website and learn HTML, then you should start by inserting .
The absence of the DOCTYPE flag can cause websites to display incorrectly. The reason is that browsers automatically switch to » quirk mode » when is missing. This helps preserve the compatibility and representability of websites without an updated code standard. But at the same time, valid code can also lead to incorrect display because some browsers stick to outdated and invalid code elements.