display | more...

The DOCTYPE is a single line of code at the top of the document that identifies the SGML DTD the document is written for. Often, this is a version of HTML or XHTML.
For example: if you wrote your webpage to comply with HTML 4.01 Transitional, you would put the HTML 4.01 Transitional DOCTYPE in as the first line of the webpage. A List Apart recently wrote the correct DOCTYPEs for the 7 flavors of HTML everyone should be using, and they are listed below. If you still have no clue what I am babbling about, HTML Tidy will automatically insert the correct DOCTYPE for you.

  • HTML 4.01 Transitional
    • <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  • HTML 4.01 Strict
    • <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  • HTML 4.01 Frameset
    • <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
  • XHTML 1.0 Transitional
    • <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  • XHTML 1.0 Strict
    • <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  • XHTML 1.0 Frameset
    • <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
  • XHTML 1.1
    • <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">


  • http://www.htmlhelp.com/tools/validator/doctype.html
  • http://www.alistapart.com/stories/doctype/

Log in or register to write something here or to contact authors.