Showing posts with label HTML Doctype. Show all posts
Showing posts with label HTML Doctype. Show all posts

Tuesday, August 14, 2012

HTML Doctype

A <!DOCTYPE> declaration helps the browser to display a web page correctly.

The <!DOCTYPE> Declaration

There are many different documents on the web. A browser can only display a document correctly, if it knows what kind of document it is.

There are also many different versions of HTML, and a browser can only display an HTML page 100% correctly if it knows the exact HTML version used in the page. This is what <!DOCTYPE> is used for.
<!DOCTYPE> is not an HTML tag. It is an information (a declaration) to the browser about what version the HTML is written in. 

In this tutorial we use the HTML5 DOCTYPE.


An HTML document with an HTML5 DOCTYPE:
<!DOCTYPE html>
<title>Title of the document</title>
The content of the document......

HTML Versions

Since the early days of the web, there have been many versions of HTML:
HTML 2.01995
HTML 3.21997
HTML 4.011999
XHTML 1.02000

Common Declarations


<!DOCTYPE html>

HTML 4.01

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
For a complete list of document type declarations, go to our DOCTYPE Reference.