The Principles of Successful Freelancing »

Tutorials about DocTypes and Quirks mode

The doctype is the first line in the HTML file that is to indicate the HTML version that the author intends the page to be written in. Ideally, you should have a valid doctype as the first line of all HTML pages. Otherwise certain browsers will render your page in "Quirks Mode".

Note that Dreamweaver can generate the doctype in a new skeleton HTML file by "File -> New -> General -> Basic Page -> HTML" and then select the "document type" from the droplist and click "Create".

To understand the different version of HTML/XHTML and which doctype to use, read Sitepoint's article "HTML or XHTML" to learn the history of the different version of HTML up to HTML 4 and the spin-off of XHTML 1.0. The article also gives some thoughts about the future versions such as HTML 5 and XHTML 2.

The article implies that there is benefit to using XHTML even if it means having to serve it as "text/html" mime-type rather than "application/xhtml+xml" mime-type as it was intended. Whether you go with HTML 4 or XHTML 1, there are three doctypes to choose from: strict, transitional, or frameset.

If you have trouble deciding which doctype to go with, we recommend going with XHTML 1.0 strict as is what you see in this article "Learn HTML and CSS: An Absolute Beginner's Guide"

What are Doctypes and its Syntax

  • What doctypes are
  • Sitepoint HTML reference about doctypes
  • Fix Your Site with Right Doctype on AListApart
  • Wikipedia info about Doctype
  • Recommended Doctypes by W3.org
  • scroll down this w3.org article and you will find the exact syntax for the various doctypes
  • scroll down this article on AListApart.com and you will see the section "Doctypes that Works" for syntax of doctype
  • Statistics of sampling of doctypes

What is Quirks Mode

  • Quirks mode and strict mode
  • This table by Eric Meyer and this table on wikipedia show you whether a certain browser will render your page in "quirks mode" or "standards mode" based on what doctype you use. Unless there is a particular reason you want "quirks mode", you ideally want browsers to render you page in "standards mode".