From http://www.quackit.com/xhtml/
This XHTML tutorial will show you how to code your pages using XHTML. It is probably much easier than you think. If you already know HTML, this XHTML tutorial should be an absolute breeze!
There are only a handful of differences between HTML and XHTML. Fortunately, they are all minor, which makes it much easier to convert your website from HTML to XHTML. Just, don't forget to declare the document.
Here are the main things to remember when writing XHTML:
All XHTML documents must have a DOCTYPE declaration. The document must include the usual html, head, title, and body elements.
Example:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Wrong
<A HREF="xhtml/xhtml_tutorial.html">
XHTML Tutorial</A>
Right
<a href="xhtml/xhtml_tutorial.html"> XHTML Tutorial</a>
Wrong
<img src="pix/xhtml_tutorial.gif">
Right
<img src="pix/xhtml_tutorial.gif" />
(Note that the XHTML specification does not require a space before the
"/" but this is required to conform with current browsers).
Wrong
<img src="pix/xhtml_tutorial.gif" width=250 height=50 border=0 />
Right
<img src="pix/xhtml_tutorial.gif" width="250" height="50" border="0" />
Wrong
<option selected>
Right
<option selected="selected">
Wrong
<img src="pix/xhtml_tutorial.gif" name="xhtml_tutorial">
Right
<img src="pix/xhtml_tutorial.gif" id="xhtml_tutorial">
Wrong
<script language="javascript" type="text/javascript" >
document.write("XHTML Tutorial from <b>HELL!</b>");
</script>
Right
<script>
<![CDATA[ document.write("XHTML Tutorial from <b>HELL!</b>"); ]]>
</script>
No improper nesting etc
Wrong
<b><i> This text is bold and italic</b> </i>
Right
<b><i> This text is bold and italic</i></b>