Learning XHTML
1.1 simply involves learning some new rules.
- Documents must be well-formed-- Elements
must have closing tags and all the elements must nest properly. <div><p><span>
needs </span></p></div>
in proper order.
- Element and attribute names must be in lower
case.
- For non-empty elements, end tags are required--
Every <div><p><span>etc.
needs a closing tag.</span></p></div>,
(nested properly, and in lower case).
- Empty Elements-- e.g.: <br>
<hr> or <img src="...">, need to be closed
with a space and forward slash, e.g.: <br />
<hr /> or <img src"...." />.
- Attribute values must always be quoted--
e.g.: class="left" or width="30", the value needs to
be in quotes.
- Attribute Minimization-- Attributes
need a value stated, even if it is redundant, e. g.: compact="compact"
is correct.
- White Space handling in attribute values--
No white space (blank space) in attribute values is allowed.
- The elements with "id" and "name"
attributes-- Use the "id" attribute, the "name"
attribute is deprecated in links.