The Web Design Group

Document Types and the WDG DTD

Introduction

Most HTML authors will use one of a fairly small number of Document Type Definitions (DTDs), published by the relevant de jure and de facto standards bodies. These have been designed to reflect current recommended practice and browser support, at the time of publication.

As regular users of HTML and developers of HTML tools, we believe we have identified some minor shortcomings in the main published DTDs. We are pleased to offer an alternative DTD, based on the current W3C recommendation but enhanced for improved accessibility as described below.

About DTDs

In the context of the WWW, a Document Type Definition (DTD) is an SGML document that defines a formal, machine-readable standard for HTML. It determines exactly what is or isn't allowed in HTML, and tells SGML-aware software, such as validators and the more advanced browsers and authoring tools, how to parse an HTML document.

The IETF, W3C and ISO/IEC DTDs

Standard DTDs for HTML and XHTML are published by the IETF, the W3C, and the ISO/IEC. The main HTML specs include:

HTML 2.0

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">

The first widely-used public DTD describing HTML as an SGML application.

HTML 3.0

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN//">

HTML 3.0 introduced Tables, figures and mathematical markup, Clientside event handling, and stylesheet support. Note that much of HTML 3.0 has not been preserved in later DTDs. With a supporting browser such as Arena, HTML 3.0 is good for presenting mathematical and scientific documents.

HTML 3.2

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

HTML 3.2 represents HTML as supported by popular browsers in 1996. It introduces a range of presentational elements introduced by Netscape and copied by most other browsers.

HTML 4.0 and 4.01

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">

HTML 4.0 and 4.01 (which is a bug-fix update on 4.0) has three separate DTDs:

  1. HTML 4.0 Strict is the recommendation for new documents, based on the premise that HTML is markup, and that complementary technologies should be used for associated functions.
  2. HTML 4.0 Transitional is a compatibility DTD for legacy HTML, incorporating minor updates from HTML 3.2 and permitting deprecated markup.
  3. HTML 4.0 Frameset is a separate DTD for documents using HTML Frames.
ISO/IEC HTML

<!DOCTYPE HTML PUBLIC "ISO/IEC 15445:2000//DTD HTML//EN">

The most recent HTML DTD and formal standard is somewhat similar to W3C's HTML 4 Strict but is significantly stricter in structural enforcement.

Custom DTDs

It is of course possible for anyone to create a custom DTD. This would typically use a SYSTEM identifier of the form <!DOCTYPE HTML SYSTEM "url.of.DTD">. For more information on creating a custom DTD, please see the WDG's Custom DTD Page.

The WDG DTD

The aim of the WDG DTD is to promote maximum accessibility and browser compatibility, without breaking existing technologies. Our first (and currently only) DTD is wdg-compat.dtd, which is designed for maximum back-compatibility, and offers full support for complementary WWW technologies such as CSS Stylesheets for presentation and JavaScript/ECMAScript for embedded programming.

wdg-compat.dtd

wdg-compat.dtd is based on the W3C's HTML 4.01 Strict, with a number of changes:

How to use the WDG DTD

To use a WDG DTD in your HTML document, you should properly use a SYSTEM identifier, although you can also use our unofficial PUBLIC identifier (as used in this document). The overall structure of your document will be:

<!DOCTYPE HTML SYSTEM "http://www.htmlhelp.org/design/dtd/wdg-compat.dtd">
<html>
  <head>
    ....
  </head>
  <body>
    ....
  </body>
</html>

For a Frameset document, you would use:

<!DOCTYPE HTML SYSTEM "http://www.htmlhelp.org/design/dtd/wdg-compat.dtd">
<html>
  <head>
    ....
  </head>
  <frameset ...>
    <frame ...> (one or more)
    <noframes>
      <body>
        ....
      </body>
    </noframes>
  </frameset>
</html>

This page is itself a simple example using wdg-compat.dtd.