Essential !DOCTYPE declarations!Any valid HTML document declares what version of HTML is used in the document. It does this by using a DOCTYPE (document type) declaration at the beginning of the file. Below are the common DOCTYPES that you should use depending on how your site is produced. HTML DOCTYPESHTML 4.01 specifies three document type declarations, so authors must include one of the following DTDs in their documents in order to validate. The DTDs vary in the elements they support. HTML4 Strict
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> HTML4 Transitional
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> HTML4 Frameset
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> XHTML DOCTYPESXHTML 1.0 Strict
<!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> Quick tip: Don't use this if your markup includes <font> tags, or <table> tags to control layout. Inside <img> tags, border, hspace, vspace and align attributes cannot be used. XHTML 1.0 Transitional
<!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> Quick Tip: This is likely to be the DEFAULT XHTML DOCTYPE until such time when all browsers support cascading style sheets XHTML 1.0 Frameset
<!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Frameset//EN" "DTD/xhtml1-frameset.dtd"> For future refence, the W3C is working on a replacment for DTDs, with something called XML Schemas, so check the W3C site every now and then for updates.
|
| |||||||