XHTML Quick-Reference

XHTML is HTML with a few simple rules. Follow these, and you'll be creating XHTML of your very own!

1. You need Doctypes and other header garbage!

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

2. Tags and attributes must be lower case!

<BODY> bad

<body> good!

3. All attributes must be quoted!

<a href=skull.html> bad

<a href="skull.html"> good!

4. All tags must close!

Obviously tags like <p>, <td>, and <i> must be properly closed.
But also, <br>, <hr>, and <img> must be closed!
This can be done like so: <br />, <hr />, and <img />

5. Watch Your Containers

6. Ampersands Must Be Converted To HTML Entities

Convert all "&" to "&amp;", even in URLs!

Validate your XHTML

Address: validator.w3.org