Web design: FAQ

Why HTML 4 and not XHTML?

Well for starters, the advantages of XHTML 1 over HTML 4 for the web designer are very very few. There are actually no new features or code, and valid HTML 4 code can be automatically and seamlessly converted to XHTML by free software like HTML Tidy. Agent software that parses XHTML documents can quite easily do the same thing.

In addition, the argument that writing XHTML 1 is in some way future-proofing your websites in preparation for emerging standards is false. The current drafts of XHTML 2 contain several major incompatibilities with XHTML 1.1 (there is no longer an IMG tag, or a BR tag, headers work differently, etc). Since it is virtually unthinkable that a new web browser will emerge that no longer supports an earlier version of HTML, the need to switch to XHTML is negligable.

Furthermore, XHTML is less forgiving of errors (some browsers will not show a document at all if there is an error). One of the few advantages of using XHTML over HTML is the ability to include other new XML languages in the same document (i.e., MathML and SVG), however including these with the OBJECT tag offers better backward compatibility and allows browsers that do not support MathML and SVG to have "plugins" handle the new formats for them. Using an OBJECT tag also allows alternative code to be shown if the format is unsupported. Integrating different XML formats into the same document is a nightmare for readability, and is extremely hard to validate.

In summary, XHTML offers very few benefits, and many more drawbacks than HTML 4, which is better supported and will likely not be dropped from popular software support for decades.

Why CSS and not table-based?

The best reason is that CSS-based design is easier: it's easier to learn, it's easier to code, and it's easier to maintain. The only browser that breaks significantly is Netscape 4 (which now occupies less than 1% of the global web browser market), and the advanced techniques section of this tutorial gives a couple of methods to hide CSS from that browser.

Another significant argument in favour of CSS-based designs is that they generally use about half the bandwidth of an equivalent table-based design. That can add up to a significant saving for commercial sites.

Of course, the philosophical arguments (better accessibility, more flexible design, mobile/handheld browsers, misuse of tables, etc. etc.) may also have some relevance depending on the target audience of your site.

On this page

Table of contents

  1. Home / About the tutorial
  2. History and context
  3. Learning HTML
    1. Document structure
    2. Marking up text
    3. Images and links
  4. Planning your site
  5. Writing your content
  6. Design and layout
    1. Writing Style-sheets
    2. Laying out your site
    3. More CSS
  7. Coding guide and tips
  8. Advanced techniques
  9. Further Reading & Resources

Example site

Help

Tips / Caveats