HTML tag

HTML5 Declaration Example

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

  <body>
    The content of the document......
  </body>
</html>
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

<html>

tag, must be declaration tag

<!DOCTYPE>

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

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

HTML 4.01 Transitional

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

HTML 4.01 Frameset

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">

XHTML 1.0 Strict

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

XHTML 1.0 Transitional

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

XHTML 1.0 Frameset

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

XHTML 1.1

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

Browser support DOCTYPE tag

Browser support DOCTYPE

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>