The doctype tag
The doctype tag tells the browser the HTML version. To specify the current, fifth version of HTML, you should write it like this:
<!DOCTYPE html>
Before HTML5 came out, you had to write scary things that were completely impossible to remember by heart. For example:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
Fortunately, doctype has been shortened and such long constructions are no longer needed. There is no need to remember them, let alone understand what they did.
The doctype tag is written at the very beginning of the document, before the html tag. The tag is mandatory, but the page will work without it, but in this case some things will work differently than with doctype. Therefore, always write it - you will avoid some problems.
Example
Let's look at the structure of the simplest HTML page:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>This is the title title</title>
</head>
<body>
This is the main content of the page.
</body>
</html>