HTML tag

HTML5 Declaration Example

<!DOCTYPE html>
    <title>Title of the page</title>

    The content of the document......
Display Null element Usage
none element must not contain any content, and does not need a closing tag structural

Doctype – Ue and Definition

First thing in your HTML document, before the


tag, must be declaration tag


in the your page.

Tag Doctype declaration isn’t an HTML tag; This tag like an instruction to yours web browsers about what version of HTML used on this page.

If you use HTML 4.01, the declaration refers to a DTD, because HTML 4.01 was based on SGML. The DTD some specifies the rules for language of markup, so that the browser render HTML code correctly.

However, HTML5 isn’t based on SGML, and doesn’t require a reference to a DTD.

Note: You must always add the tag into your HTML document, so that the browsers knows what type of documents to expect.

Why need DOCTYPEs

DOCTYPEs are required for legacy reasons. When omitted, browsers tend to use a different rendering mode that is incompatible with some specifications. Including the DOCTYPE in a document ensures that the browser makes a best-effort attempt at following the relevant specifications.

DOCTYPES you might encounter

There is virtually no reason to compose new HTML documents in the old standards. But, you may see any of the all document types on legacy systems:

HTML 4.01 Strict


HTML 4.01 Transitional

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">

HTML 4.01 Frameset

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "">

XHTML 1.0 Strict

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">

XHTML 1.0 Transitional

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

XHTML 1.0 Frameset

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "">


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "">

Browser support DOCTYPE tag

Browser support DOCTYPE

Leave a Reply