Description:

The HTML <!DOCTYPE> tag is used for specifying which language and version the document is using. This is referred to as the document type declaration (DTD).

With the introduction of HTML 5, the <!DOCTYPE> tag is mostly useless, as HTML 5 does not require a reference to a DTD. Having said that, for legacy reasons, the HTML 5 specification recommends including the <!DOCTYPE> header at the top of all HTML documents.

Example Code:
<!DOCTYPE html>
<html>
<head>
<title>Document Title</title>
</head>
<body>
<p>Document Contents</p>
</body>
</html>
Attributes:

None



Last updated on 2 August 2018 By Rene Spronk

View All HTML Tags

Errors? Please help to keep this list up to date, If you find any errors, please contact us, so that we can get them fixed.