Empty Elements Must Also Be Closed
Empty elements must either have an end tag or the start tag must end with />
.
This is wrong:
This is a break<br>Here comes a horizontal rule:<hr>
Here's an image <img src="happy.gif" alt="Happy face">
This is correct:
This is a break<br />
Here comes a horizontal rule:<hr />
Here's an image <img src="happy.gif" alt="Happy face" />
To make your XHTML compatible with today's browsers, you should add an extra space before the "/" symbol like this: <br />, and this: <hr />.
Attribute Minimization Is Forbidden
This is wrong:
<input type="checkbox" checked>
<input readonly>
<input disabled>
<option selected>
<frame noresize>
This is correct:
<input type="checkbox" checked="checked" />标注部分是自加的,以用来理解。
<input readonly="readonly" />
<input disabled="disabled" />
<option selected="selected" />
<frame noresize="noresize" />
The Lang Attribute
The lang attribute applies to almost every XHTML element. It specifies the language of the content within an element.
If you use the lang attribute in an element, you must add the xml:lang attribute, like this:
<div lang="no" xml:lang="no">Heia Norge!</div>