Home | All Questions | alt.html FAQ >

What is a Doctype?

It's the component of an SGML document (of which an HTML document is supposed to be an instance in this case) that contains the formal definition of the markup grammar (valid element type names, which elements contain which, valid attribute names, etc.) An SGML parser has to process these definitions before it can check the instance markup. A shorthand form of the _document type declaration_ is where some or all of these formal definitions are gathered together in a separate file and incorporated much like a '#include' preprocessor statement would work in C. An _external identifier_ like "-//W3C//DTD HTML 4.01 Transitional" is a location- and context-independent name for such a file. (You'll here a whole bunch of mythology to the effect that this name is about the HTML spec itself, or about how HTML semantics are announced, but all of that is bogus.)

Web browser manufacturers are increasingly adopting the schizophrenic version-modes, normally with two modes: standard-compliant mode, and the bugward-compatible mode. Vendor specific notes are:

Recommended Resources

Discussion

Related Questions