November 07, 2003

Moving up to XHTML

XHTML is the next generation of HTML: XHTML is not very different from HTML 4.01, so bringing your code up to 4.01 standards is a very good start.

The Most Important Differences:

  • XHTML elements must be properly nested
  • XHTML documents must be well-formed
  • Tag names must be in lowercase
  • All XHTML elements must be closed

This XHTML Tutorial will help you on your way.

It is very important to validate your code using the available online resources.

You can also validate your CSS code while you are at it.

You will need to start each xhtml document with a document type declaration (DTD). There are three you can choose from:

  • Strict -
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
  • Transitional -
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  • Frameset -
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "DTD/xhtml1-frameset.dtd">

If you have lots of existing HTML code, you'd probably want to use the Transitional DTD.

Finally, let's let our tax dollars work for us for a change! Here is a page from the EPA with tips to make sure your html code complies to XHTML standards.

Posted by mark at November 7, 2003 02:03 PM | TrackBack
Comments
Post a comment









Remember personal info?