HTML and CSS Reference
On the other hand, the following:
<b>Well formed, this is <i>not!</b></i>
is not well formed.
XHTML strictly enforces other nesting restrictions that have always been
part of HTML but have not always been enforced. These restrictions are
not formally part of the XHTML DTD; they are instead defined as part of
the XHTML standard that is based on the DTD. [*]
[*] This is hair splitting within the XHTML standard. The XML standard has no mechanism to define
which tags may not be placed within another tag. SGML, upon which XML is based, does have such a
feature, but it was removed from XML to make the language easier to use and implement. As a result,
these restrictions are simply listed in an appendix of the XHTML standard instead of being explicitly
defined in the XHTML DTD.
Nesting restrictions include the following:
• The <a> tag cannot contain another <a> tag.
• The <pre> tag cannot contain <img> , <object> , <big> , <small> ,
<sub> , or <sup> tags.
• The <button> tag cannot contain <input> , <select> , <textarea> ,
<label> , <button> , <form> , <fieldset> , <iframe> , or <isindex> tags.
• The <label> tag cannot contain other <label> tags.
• The <form> tag cannot contain other <form> tags.
These restrictions apply to nesting at any level. For example, because
an <a> tag cannot contain any other <a> tags, any tag contained within
that <a> tag cannot itself contain an <a> tag, even though it might oth-