HTML <!DOCTYPE> Tag

Description

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

Properties

Permitted Parents
-
Content
-
Start/End Tags
-

Example

<!DOCTYPE html>
<html>
<head>
<title>Document Title</title>
</head>
<body>
<p>Document Contents</p>
</body>
</html>

Attributes

None

Global Attributes

None

Event Attributes

None

Browser Support

The following table will show you the current browser support for the HTML <!DOCTYPE> tag.

Desktop
Edge Chrome Firefox Opera Safari
1211151
Tablets / Mobile
Chrome Firefox Opera Safari Samsung Webview
18414114.4

Last updated by CSSPortal on: 30th September 2023