Learn one of the most powerful programming languages in the world and become a rockstar developer.

HTML Doctypes

HTML Doctypes

A Document Type Declaration, or DOCTYPE, is an instruction to the Web browser about the version of markup language in which a page is written.

HTML5 Doctype

A DOCTYPE declaration appears at the top of a web page before all other elements. According to the HTML specification or standards, every HTML document requires a document type declaration to insure that your pages are displayed the way they are intended to be displayed. The doctype declaration is usually the very first thing defined in an HTML document; however the doctype declaration itself is not an HTML tag.

The DOCTYPE for HTML5 is very short, and case-insensitive.

<!DOCTYPE  html>

Doctypes from earlier versions of HTML were longer because the HTML language was SGML-based and therefore required a reference to a DTD, but they are obsolete now. With HTML5 this is no longer the case and the doctype declaration is only needed to enable the standard mode for documents written using the HTML syntax.

You can use the following markup as a template to create a new HTML5 document that uses the latest HTML5 doctype declaration.

<!DOCTYPE html>
<html lang="en">
        <title><!-- Insert your title here --></title>
        <!-- Insert your content here -->

We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Privacy Policy That's Fine