Extra Credit: HTML 4.0.1

  1. Why XHTML 1.0?
  2. Extra Credit
  3. Blog comments

You can see an example of HTML 4.0.1 in the Samples folder, as “Carnival (HTML).html”. This is the same as the final “Carnival (Completed).html” but modified to conform to HTML 4.0.1. If you view both of those files side-by-side in your browser, they should display the same (I tested it in Safari 4 and Firefox 3.5).

HTML is much more free-form than XHTML. Many tags only need to be marked at their opening and don’t need an ending. You can also mix capitalization to make some tags stand out more.

In this page, I’ve removed the abbreviated closing slash from the meta tags and the link tag, because they’re invalid in HTML 4; I also removed the abbreviated closing slash from the img tags because they generate a warning.

I’ve removed the ending tags for all of the paragraphs and list items, and all of the table rows and most of the table cells. Two table cells still needed them: the header cell for “More links” and the header cell for “Formats”. That’s because without the closing tag, browsers will include the line breaks and other white space as part of the cell data, resulting in an extra space on those right-aligned cells.

If you find that HTML 4.0.1 works better for you, there’s nothing wrong with using it. This is the doctype that goes at the very top of the file:

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

It uses a simple <html> tag to open the web page.

  1. Why XHTML 1.0?
  2. Extra Credit
  3. Blog comments