• Document type declaration otherwise known as Doctype is an instruction used by web browsers to fetch what version of HTML the website is written in.
  • For understanding, it helps browsers how the document should be interpreted thus eases the rendering process. It is neither a tag nor an element.
  • The top of the document was the Doctype should be placed.
  • It does not need a closing tag and does not contain any content.

Syntax:

<!DOCTYPE html>

For example,

<!DOCTYPE html>
<html>
<body>
<h1>Welcome to Kaashiv Infotech</h1>
<h2>This is HTML5 Doctype Tag</h2>
</body>
</html>

Output

Categorized in: