<!DOCTYPE>

The <!DOCTYPE> declaration tells the browser that a given file is a markup .html file and that a set of web standards must be applied to it. It is the first line of code that go at the top of every HTML or XHTML file.

Note: <!DOCTYPE> is not an element or a tag.

Syntax

<!DOCTYPE html>

Example

The <!DOCTYPE> declaration is added to the top of an HTML file.

<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>
<body>
The content of the document...
</body>
</html>
Edit this page on GitHub

Contributors

Interested in helping build Docs? Read the Contribution Guide or share your feedback.

Learn HTML on Codecademy