HomePage | RecentChanges | Preferences | Newbie Help
- What is a DOCTYPE and which one do I use?
Works in NS6 --
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- What do you mean by "works in NS6"? IIRC all Doctypes 'work' in NS6, they just activate different layout modes. Matthias Gutfeldt
- "Layout modes"? Oh dear.... The rumors were true, then.... -- Jerry Muelver
- How is the lack of a doctype an error?
- "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. [...]"
- "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."
- "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."
- "You've done all the right things, but your site doesn’t look or work as it should in the latest browsers. You’ve written valid XHTML and CSS. You’ve used the W3C standard Document Object Model (DOM) to manipulate dynamic page elements. Yet, in browsers designed to support these very standards, your site is failing. A faulty DOCTYPE is likely to blame. This little article will provide you with DOCTYPEs that work, and explain the practical, real–world effect of these seemingly abstract tags."