1. XHTML requires proper nesting
Error: <p>xhtml document <strong> main differences from HTML </p></strong>
Correct: <p>xhtml document <strong> main differences from HTML </strong></p>
2. All XHTML elements must be closed
Under the HTML some primitive can be used alone, such as <p> tags, can not write </p>. However, under XHTML, it is required to write a close tag.
Error: The main difference between <p>xhtml and HTML
Correct: The main difference between <p>xhtml and HTML </p>
Some empty elements are written in XHTML with spaces and slashes before ">", such as:
<br/>
3. XHTML is case-sensitive
The HTML is case-insensitive, but is distinguished in XHTML. XHTML all tags and attributes are lowercase. Such as:
Error:
Correct:
4. XHTML attribute values are quoted
Error: <table width=800
Correct: <table width= "800"
Property values can be in double quotes, or single quotes, but paired.
5. XHTML replaces the name attribute with the id attribute
Error:
Correct:
6. Attribute value cannot be shortened
In HTML, some element attribute values have only a single fixed value, so you can write property names without writing property values, but you must write property names and property values in XHTML. Such as:
Error: <input type= "Radio" checked>
Correct: <input type= "Radio" checked= "checked" >
The difference between XHTML and HTML