HTML5 <!DOCTYPE>

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

In HTML5, the <!DOCTYPE> declaration is much simpler than in previous versions of HTML:

Copy to Clipboard
<!DOCTYPE html>

Usage Example

The <!DOCTYPE> declaration must go right at the top of the page, before any other HTML code.

Copy to Clipboard
<!DOCTYPE html>
<html>
 <head>
 </head>
 <body>
   <p>Page content...</p>
 </body>
</html>

Note that the <!DOCTYPE> declaration is case-insensitive.

Also see the HTML 4.01 tags


Enjoy this page?

  1. Link to this page (copy/paste into your own website or blog):
  2. Link to Quackit using one of these banner ads.

Thanks for supporting Quackit!

Sponsored Link: Design CODE-FREE Websites

Check a Domain:

ZappyHost Logo
Webydo Banner Ad