View video tutorial

HTML <!DOCTYPE> Tag.

HTML

The <!DOCTYPE> tag is used to specify the document type declaration.

HTML <!doctype> Tag


It is an information for the browser.

Browser loads correct documents.

<!DOCTYPE> must be placed at the top of the HTML page.

<!DOCTYPE html> is used to specify for HTML5 document.

<!DOCTYPE html>

Learning with HTML Editor "Try it Now"

You can edit the HTML code and view the result using online editor.

Example

<!DOCTYPE html>
<html>
<head>
    <title>HTML Doctype Example</title>
</head>
<body>
    <h2>HTML Doctype Example</h2>
    <p>HTML5 doctype declaration is very simple. It must be placed at the very beginning of the HTML page</p>
    <p>The body content goes inside the body tag.</p>
</body>
</html>
Try it Now »

Click on the "See output" button to see how it works.