On Transitional and Strict

This article will describe the difference between the three flavours of HTML 4/4.01 and XHTML 1.0, give some examples of use, and suggest a choice of standard to work with.

Tina Holmboe

Table of Contents

Introduction

Starting with version 4, first published in 1997, HTML exist in three different flavours: Transitional, Frameset, and Strict. These can be thought of as distinct, but overlapping, versions of the same language.

When XHTML 1.0 arrived in 2000, the decision was made to retain this structure; although XHTML 1.1 dispensed with both the Transitional and Frameset variety. At the time of writing, May 2007, it would appear likely that the upcoming HTML 5 specification will follow suit and have only one version.

For the most part the set of elements and attributes overlap between the three versions.

Each version is represented by a DTD — a Document Type Definition — file which encode the language’s syntax. Note that the following is correct for HTML 4.0, HTML 4.01, and XHTML 1.0, but that all element names are in upper–case for easy reference. In XHTML they should of course be written in lower–case.

Strict

The strict version of HTML 4, 4.01, and XHTML 1.0, include all the elements and attributes which has not been deprecated — i.e. flagged for future removal — from HTML 3.2. It does not, however, include any frame–related elements or attributes.

Despite the name, “Strict” is no more strict in terms of parsing than Transitional or Frameset. Instead, the name reflect the purpose of the language — to focus on structural elements, avoiding the presentational tags of previous versions.

The following DOCTYPE is appropriate for strict documents in HTML 4.01. Please note: this will trigger standards compliant mode in Opera 8+, Firefox 1+, and IE 6+.

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

Elements included are, for instance ABBR, P, and UL.

Transitional

This version include all the elements and attributes in Strict, as well as all deprecated elements and attributes. It does not include any frame related material.

If, for some reason, you have a need to use elements such as FONT, then Transitional is the right choice, while keeping in mind that as the name suggest this version should only be used while phasing out old usage of markup for presentation.

The following DOCTYPE is appropriate for transitional documents in HTML 4.01. Please note: this will trigger standards compliant mode in Opera 8+, Firefox 1+, and IE 6+.

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

Eleven (11) elements are added to Transitional when compared with Strict: APPLET, BASEFONT, CENTER, DIR, FONT, IFRAME, ISINDEX, MENU, S, STRIKE, and U.

Frameset

The widest of the three, the “Frameset” version include all elements and attributes from “Transitional”, as well as those needed for frame–usage.

The following DOCTYPE is appropriate for frameset documents in HTML 4.01 Please note: this will trigger standards compliant mode in Opera 8+, Firefox 1+, and IE 6+.

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

Three (3) elements are added when compared to Strict: FRAME, FRAMESET and NOFRAMES.

Choosing One

In theory, an author should chose which version to use based on the following questions:

The complete list of elements in HTML 4.01 can be found at W3C’s Index of Elements. To see which elements exist in which version of the language, study the column named “DTD”. An entry for an element marked as “L” means it exist in the Transitional version; an entry “F” means it exist in Frameset. No entry would mean it is found in Strict.

References

Title Author Date
Transitional Document Type Definition W3C December 1999
Frameset Document Type Definition W3C December 1999
Document Type Definition W3C December 1999
CSS Enhancements in Internet Explorer 6 Microsoft Corp. September 2006
Mozilla’s DOCTYPE sniffing Mozilla Foundation May 2007
Opera 9 DOCTYPE Switches, The Opera Software ASA

Document Information

First published: 23rd of May 2007
Last update: 6th of October 2008
Prerequisite: Knowledge of HTML
Author: Tina Holmboe
Maintained by: Tina Holmboe