Differences between strict & transitional (X)HTML

06 Mar 2009 by David Corvoysier

HTML and XHTML exist today in two flavors: strict and transitional. By default, a lot of editing tools or CMS use the transitional model.

This is a shame because it may lead people to use a deprecated HTML syntax for presenting content instead of using CSS. This will lead to future incompatibilities and extensive use of the "Quirks mode".

I will summarize below the main differences between the strict and transitional models. Then, the reader may be able to figure out whether he can safely switch to (X)HTML strict or not.

Elements only allowed in transitional (X)HTML

The list below has been compiled using this full XHTML doctypes element comparison

  • applet,
  • basefont,
  • center,
  • dir,
  • font,
  • frame,
  • frameset,
  • iframe,
  • isindex,
  • menu,
  • noframes,
  • s,
  • strike,
  • u,

Today, only the iframe element is still used widespread, despite the fact that it can be replaced by object.

Attributes only allowed in transitional (X)HTML

The list below has been compiled using this full XHTML doctypes element attributes comparison

  • align in anything but tables-related elements,
  • alink,
  • background,
  • bgcolor,
  • border,
  • color,
  • compact,
  • dir,
  • face,
  • frameborder,
  • height,
  • hspace,
  • ismap,
  • height,
  • lang,
  • link,
  • noshade,
  • nowrap,
  • object,
  • size,
  • start,
  • target on anchors a,
  • text,
  • type,
  • version,
  • vlink,
  • vspace,
  • width.

As you can see, most of these attributes can easily be replaced by CSS rules. The only one that is still used widespread is a.target. In my humble opinion, this is not a problem, because you should not decide to open a link in a new window on behalf of the user. Anyway, if you really want to do that, you can still use javascript.

Document structure constraints in strict (X)HTML

The body, blockquote and form must only contain block-level elements like div or span.
comments powered by Disqus