How to Use HTML5 Doctype?

The first thing that should be in your HTML files is a DOCTYPE declaration. Many website owners may simply copied them when they have used them at all, without really thinking about it. However this is really issue every site designers should look into. The declaration is not an HTML tag; it is an instruction to the web browser about what version of HTML the page is written in. HTML5 uses a DOCTYPE declaration which is very short, due to its lack of references to a DTD in the form of a URL or FPI. All it contains is the tag name of the root element of the document, HTML. In HTML 5, means the page is written in HTML5. Unlike earlier versions of HTML, such as HTML 4.01 which has different declarations and require a DTD reference, The doctype in HTML 5 has just one word, without any references.

In the words of the specification draft itself:
In other words,

, case-insensitively.

How to use DOCTYPE in HTML 5 pages?

1. The declaration is not an HTML tag; The HTML 5 DOCTYPE declaration must be at the top of any HTML 5 page, before the tag.
2. HTML5 does not require a reference to a DTD. Here is an example of one common type of XHTML 1.0 Transitional:
3. Always add the HTML 5 doctype declaration to any HTML 5 documents, so that the browser knows what version of HTML the page is written in.
4. The HTML 5 DOCTYPE tag does not have an end tag.
5. The DOCTYPE in HTML 5 declaration is NOT case sensitive.

Leave a Reply