HTML and CSS Reference
In-Depth Information
figure 9-8
child elements prohibited under the strict DtD
Element
Prohibited Children
inlineƒelements
anyƒblock-levelƒelement
body
a,ƒabbr,ƒacronym,ƒb,ƒbdo,ƒbig,ƒbr,ƒbutton,ƒcite,ƒcode,ƒdfn,ƒ
em,ƒi,ƒimg,ƒinput,ƒkbd,ƒlabel,ƒmap,ƒobject,ƒq,ƒsamp,ƒselect,ƒ
small,ƒspan,ƒstrong,ƒsub,ƒsup,ƒtextarea,ƒtt,ƒvar
button
button,ƒform,ƒfieldset,ƒiframe,ƒinput,ƒisindex,ƒlabel,ƒ
select,ƒtextarea
blockquote
a,ƒabbr,ƒacronym,ƒb,ƒbdo,ƒbig,ƒbr,ƒbutton,ƒcite,ƒcode,ƒdfn,ƒ
em,ƒi,ƒimg,ƒinput,ƒkbd,ƒlabel,ƒmap,ƒobject,ƒq,ƒsamp,ƒselect,ƒ
small,ƒspan,ƒstrong,ƒsub,ƒsup,ƒtextarea,ƒtt,ƒvar
form
a,ƒabbr,ƒacronym,ƒb,ƒbdo,ƒbig,ƒbr,ƒcite,ƒcode,ƒdfn,ƒem,ƒform,
i,ƒimg,ƒkbd,ƒmap,ƒobject,ƒq,ƒsamp,ƒsmall,ƒspan,ƒstrong,ƒsub,ƒ
sup,ƒtt,ƒvar
label
label
pre
big,ƒimg,ƒobject,ƒsmall,ƒsub,ƒsup
Thus, the following code would be disallowed under the strict DTD because it places
an inline image as a child of the body element:
<body>
ƒƒƒ<imgƒsrc=”logo.jpg”ƒalt=”WizardƒWorks”ƒ/>
</body>
However, you could make this code compliant with the strict DTD by placing the
inline image within a paragraph, as follows:
<body>
ƒƒƒ<p>
ƒƒƒƒƒƒ<imgƒsrc=”logo.jpg”ƒalt=”WizardƒWorks”ƒ/>
ƒƒƒ</p>
</body>
The goal of this rule is to enforce the inline nature of the img element. Because an
inline image is displayed inline within a block element such as a paragraph, it should not
be found outside of that context. For the same reason, form elements such as the input
or select elements should be found only within a form, not outside of one under the
strict DTD.
The Valid Use of Attributes
DTDs also include different rules for attributes and their use. Under the strict DTD,
deprecated attributes are not allowed. A list of these prohibited attributes with their cor-
responding elements is displayed in Figure 9-9.
Search WWH ::




Custom Search