The declaration must be the very first thing in your HTML5 document, before the tag.
The doctype declaration is not an HTML tag; it is an instruction to the web browser about what version of the markup language the page is written in.
It is important that you specify the doctype in all HTML documents, so that the browser knows what type of document to expect.
The doctype in HTML 4.01 required a reference to a DTD, because HTML 4.01 was based on SGML. HTML5 is not based on SGML, and does not require a reference to a DTD, but need the doctype for browsers to behave as they should.
If this post helps you, then mark as "Correct Answer"
Prabhu RajaPosted Sep 14, 2011, 12:58 AM
The declaration must be the very first thing in your HTML5 document, before the tag.
The doctype declaration is not an HTML tag; it is an instruction to the web browser about what version of the markup language the page is written in.
It is important that you specify the doctype in all HTML documents, so that the browser knows what type of document to expect.
The doctype in HTML 4.01 required a reference to a DTD, because HTML 4.01 was based on SGML. HTML5 is not based on SGML, and does not require a reference to a DTD, but need the doctype for browsers to behave as they should.
If this post helps you, then mark as "Correct Answer"