IN THIS APPENDIX
Other Common Attributes
This appendix provides a reference to XHTML 1.1 markup conventions and standards. As a result of its XML heritage, XHTML is much less forgiving than HTML has historically been (or, perhaps more accurately, than HTML browsers have been). You cannot omit closing tags or place an italic (
i) element inside an anchor (
a) element. Attribute values must be quoted, and minimized attributes are disallowed, which leads to odd constructs such as
<select multiple="multiple">. The more strict conventions help ensure that your code is more standards-compliant and forward-looking.
Here are some tips to keep in mind when working with XHTML:
XHTML documents must be well-formed (closing tags required, no overlapping tags allowed).
Empty elements can be both opened and closed with one tag:
All elements and tags must be in lowercase.
Attribute values must be quoted (with either single or double quotes).
Attributes cannot be minimized—that is, all attributes must have values. For example, the
textarea element supports a
readonly attribute. In HTML, the attribute had to be present only in the element, such as
<textarea readonly>. In XHTML, however, the
readonly attribute must have a value. When a value is not applicable, the name of the attribute is generally used, such as
In the element listings that follow, the location within a document in which ...