XHTML validation rules
An XHTML document must be well-formed XML. It must conform to basic XML syntax:
Tag and attribute names must be written in lower-case.
Elements must nest; no overlapping. With XML and XHTML, you need to close the tags in reverse order -- in other words: last opened, first closed.
All non-empty elements must be closed. For example, with HTML, many people use the
<p> tag to separate paragraphs. This tag is designed to mark the beginning and (with the closing
</p> tag) end of a paragraph. That makes it a non-empty tag since it contains the paragraph text.
Affected elements: <basefont>, <body>, <colgroup>, <dd>, <dt>, <head>, <html>, <li>, <p>, <tbody>, <thead>, <tfoot>, <th>, <td>, <tr>.
Empty elements must be terminated. All empty elements must use the XML empty tag syntax with a trailing forward slash before the end bracket (for example,
<br />). Note the space after the element text and the closing delimiter,
/>. This is for compatibility with current browsers.
Affected elements: <area>, <base>, <br>, <col>, <frame>, <hr>, <img>, <input>, <isindex>, <link>, <meta>, <option>, <param>.
Attribute values must be quoted. No more
<img ... border=0>. You now need to put quotes around every attribute, even if it's numeric.
Attribute value pairs cannot be minimized. No stand alone attributes (also known as minimized attributes) are allowed. For example,
<option selected> is no longer valid. Instead, you must use
Inline tags cannot contain block-level tags. For example, an anchor tag cannot enclose a table.