HTML.DOCTYPE


HTML (before version 5) is an implementation of SGML, and there is therefore defined by a Document Type Definition (or DTD). A valid HTML document declares what version of HTML is in use within the document. The document type declaration (DOCTYPE) names the document type definition (DTD) in use for the document.

There are multiple options for document types, each catering to a different level of backwards compatibility.

For the latest stable, strict version (with all deprecated elements removed) use the Strict DTD:

From the W3C spec: "The HTML 4.01 Strict DTD includes all elements and attributes that have not been deprecated or do not appear in frameset documents. For documents that use this DTD, use this document type declaration:"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
        "http://www.w3.org/TR/html4/strict.dtd">
<html>
  ...