View Full Version : What's this "DOCTYPE" thing?


Silent Bob
11-09-2005, 12:03 AM
Pulled from a few USENET postings


A valid HTML document declares what version of HTML is used in the
document. The document type declaration names the document type
definition (DTD) in use for the document. HTML 4.01 specifies three
DTDs, so authors must include one of the following document type
declarations in their documents. [...]
http://www.w3.org/TR/html401/struct/global.html#h-7.2


According to HTML standards, each HTML document requires a document
type declaration. The "DOCTYPE" begins the HTML document and tells a
validator which version of HTML to use in checking the document's
syntax.
choosing a doctype
http://www.htmlhelp.org/tools/validator/doctype.html


Doctype switching and standards compliance: An overview
Summary: Some modern browsers have two rendering modes. Quirk mode
renders an HTML document like older browsers used to do it, e.g.
Netscape 4, Internet Explorer 4 and 5. Standard mode renders a page
according to W3C recommendations. Depending on the document type
declaration present in the HTML document, the browser will switch into
either quirk mode or standard mode. If there is no document type
definition present, the browser will switch into quirk mode.
http://gutfeldt.ch/matthias/articles/doctypeswitch.html


DOCTYPE tags in HTML signify which standard the HTML follows, if any.
In the past, DOCTYPEs have not been that meaningful and many Web page
authors and authoring tools use DOCTYPEs that do not match the actual
HTML. Modern browsers such as NS6 and Internet Explorer 5 for the Mac
[and IE6] sniff the DOCTYPE to determine whether an HTML page should be
laid out according to the "Quirky" behavior of earlier browsers or if
it should be laid out using the stricter modern standards. It is very
important that you use the appropriate DOCTYPE in order to tell the
browser how you expect your page to be laid out.

http://www.webreference.com/programming/javascript/netscape6/2.html


DOCTYPEs are a key component of compliant web pages: your markup and
CSS won’t validate without them. As mentioned in previous ALA articles
(and in other interesting places), DOCTYPES are also essential to the
proper rendering and functioning of web documents in compliant browsers
like Mozilla, IE5/Mac, and IE6/Win.
http://www.alistapart.com/stories/doctype/

doctype explanations
http://htmlhelp.com/reference/html40/html/doctype.html

comparison table:
http://gutfeldt.ch/matthias/articles/doctypeswitch/table.html

Activating the Right Layout Mode
http://www.hut.fi/u/hsivonen/doctype.html
microsoft:
http://msdn.microsoft.com/workshop/author/css/overview/cssenhancements.
asp
mozilla:
http://www.mozilla.org/docs/web-developer/quirks/doctypes.html
opera:
http://www.opera.com/docs/specs/doctype/

Andrew Green
11-09-2005, 12:08 AM
"xhtml strict" No arguing :D