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.


<!DOCTYPE html>


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

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


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

Learn HTML on Codecademy