HTML5 Code Tutorial

Doctype Tag

The doctype tag is the first tag on any HTML page. <!DOCTYPE>

It is not actually an HTML tag , but rather an SGML (Standard Generalized Markup Language) declaration.

In the early days of the web it was used to tell a browser what version of HTML was used to build the page.

Today it tells a browser what media, HTML, XHTML or other, the page is built with.

It also tells a validator which version of media to use in checking the document's syntax.

If omitted the page will still work because the browser assumes a default value.

It is a good idea to include the tag, because browsers of the future could very well require it and it is required when validating web pages at the W3C.


HTML5 simplifies everything with:

<!DOCTYPE html>

The W3C states that the HTML5 doctype is case sensitive.


Next see: Basic HTML Page