HTML4 HTML5
The <!DOCTYPE> declaration (we do not call it a tag) appears at the very beginning of the HTML page code, before the <html> tag. The declaration informs the browser about the version of HTML in which the page was written.
A typical HTML document is divided into two sections. The !DOCTYPE declaration is located at the very beginning:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
Page content ....
</body>
</html>
In HTML5, the declaration has a very simple form, shown in the example above: <!DOCTYPE html>
In HTML4, we had three fairly complex variations of this declaration: