Documents must be well organized
XHTML is an application of XML. Some of the habits that are completely valid in SGML-based HTML 4 must be changed in XHTML. Well-formedness is a new concept introduced in [XML. Essentially, this means that the element must have an end tag or be written in a special way (as described below ).
Elements must be nested. Although SGML requires that the stack is illegal, existing browsers generally allow the stack.
Correct: nested element.
<P> here is an emphasized <em> paragraph </em>. </p>
Incorrect: stacked element.
<P> here is an emphasized <em> paragraph. </p> </em>
The element and attribute names must be in lowercase.
For all HTML elements and attribute names, the XHTML document must be in lowercase.
Because XML is case sensitive, this difference is required. For example, <li> and <LI> are different labels.
The end label must be used for non-empty elements.
In SGML-based HTML 4, some elements with an implicit ending meaning can ignore the ending label. In XML-based XHTML, this type of ignore is not allowed. All elements except the elements declared as null in the DTD must have an end tag.
Correct: The end element.
<P> here is a paragraph. </p> <p> here is another paragraph. </p>
Incorrect: The element is not ended.
<P> here is a paragraph. <p> here is another paragraph.
The property value must be enclosed in quotation marks.
All attributes must be enclosed in quotation marks, even numbers.
Correct: attribute value in quotation marks
<Table rows = "3">
Incorrect: The attribute value is not in quotation marks.
<Table rows = 3>
Minimize attributes
XML does not support attribute minimization. Attribute value pairs must be fully written. Attribute names such as compact and checked can appear in elements without specifying attribute values.
Correct: the attribute is not minimized.
<Dl compact = "compact">
Incorrect: The attribute is minimized.
<Dl compact>
Empty element
An empty element must either have an end tag, or the start tag must end with a/>. for example, <br/> or