The <!Doctype html>

Post thumbnail

Posted 07.17.2009 in html5

The <!Doctype html> declaration is the very first thing in your document, before the <html> tag. This tag tells the browser which HTML specification the document uses.

Personally I like the new Doctype, its simple and easy to remember and use without having to copy and paste from site to site.

I initially expected to see <!Doctype html5> but
considering backwards compatibility <!Doctype html> is a good solution.

While there are 3 different Doctypes in HTML 4.01 and XHTML 1, there is only one in HTML5. This is because HTML5 is not based on SGML and therefore does not need to reference a DTD.

It is important that you specify the doctype in all HTML documents, so that the browser knows what type of document to expect.

Author:

Leave a Comment