Some of the most common errors in XHTML are:
* Not closing empty elements (elements without closing tags in HTML4)
o Incorrect:
o Correct:
Note that any of these are acceptable in XHTML: , and . Older HTML-only browsers will generally accept and . Using gives some degree of backward and forward compatibility.
* Not closing non-empty elements
o Incorrect: This is a paragraph.This is another paragraph.
o Correct: This is a paragraph.This is another paragraph.
* Improperly nesting elements (elements must be closed in reverse order)
o Incorrect: This is some text.
o Correct: This is some text.
* Not specifying alternate text for images (using the alt attribute, which helps make pages accessible to users of devices that do not load images and to the visually impaired)
o Incorrect:
o Correct:
o Correct (XHTML 2.0): Powered By Nueva Design
* Putting text directly in the body of the document (this is not an error in XHTML 1.0 Transitional)
o Incorrect: Welcome to my page.
o Correct: Welcome to my page.
* Nesting block-level elements within inline elements
o Incorrect: Introduction
o Correct: Introduction
* Not putting quotation marks around attribute values
o Incorrect:
o Correct:
* Using the ampersand outside of entities (use & to display the ampersand character)
o Incorrect: Cars & Trucks
o Correct: Cars & Trucks
* Using the ampersand outside of entities in URLs (use & instead of & in links also)
o Incorrect: News
o Correct: News
* Using uppercase element or attribute names
o Incorrect: The Best Page Ever
o Correct: The Best Page Ever
* Attribute minimization
o Incorrect: READ-ONLY
o Correct: READ-ONLY
* Using document.write()in scripts instead of node creation methods, e.g. document.createElementNS(); document.getElementById().appendChild();
* Using comments in embedded scripts and stylesheets. In XHTML the contents of the comment block are invisible to the browser. Consider
In XHTML this is equivalent to the following because the content of the comment is removed from the parse tree.
Whilst in HTML it is equivalent to the following, which is probably what was intended.
p { color: green; }
Instead, the above should be written using the syntax.
This is not an exhaustive list, but gives a general sense of errors that XHTML coders often make.
http://www.nueva-design.com/nvd/Client-Side-Coding/XHTML-Tutorial/XHTML-Tutorial-10.html



