<!DOCTYPE> tag is used for specifying which language and version the document is using. This is referred to as the document type declaration (DTD).
With the introduction of HTML5, the <!DOCTYPE> tag is mostly useless, as HTML 5 does not require a reference to a DTD. Having said that, for legacy reasons, the HTML5 specification recommends including the <!DOCTYPE> header at the top of all HTML documents.
In HTML5, the <!DOCTYPE> declaration is much simpler than in previous versions of HTML:
The <!DOCTYPE> declaration must go right at the top of the page, before any other HTML code.
<!DOCTYPE html> <html> <head> </head> <body> <p>Page content...</p> </body> </html>
Note that the <!DOCTYPE> declaration is case-insensitive.
Also see the HTML 4.01 tags
Enjoy this page?
- Link to this page (copy/paste into your own website or blog):
- Link to Quackit using one of these banner ads.
Thanks for supporting Quackit!