HTML and CSS Reference
In-Depth Information
figure 9-11
DtDs for different versions of HtML and XHtML
DTD
DOCTYPE
HTML 2.0
<!DOCTYPEƒhtmlƒPUBLICƒ“-//IETF//DTDƒHTMLƒ2.0//EN”>
HTML 3.2
<!DOCTYPEƒhtmlƒPUBLICƒ“-//W3C//DTDƒHTMLƒ3.2ƒFinal//EN”>
HTML 4.01 strict
<!DOCTYPEƒhtmlƒPUBLICƒ“-//W3C//DTDƒHTMLƒ4.01//EN
HTML 4.01 transitional
<!DOCTYPEƒhtmlƒPUBLICƒ
ƒƒ“-//W3C//DTDƒHTMLƒ4.01ƒTransitional//EN”
HTML 4.01 frameset
<!DOCTYPEƒhtmlƒPUBLICƒ“-//W3C//DTDƒHTMLƒ4.01ƒFrameset//EN”
HTML5
<!DOCTYPEƒhtml>
XHTML 1.0 strict
<!DOCTYPEƒhtmlƒPUBLICƒ“-//W3C//DTDƒXHTMLƒ1.0ƒStrict//EN”
XHTML 1.0 transitional
<!DOCTYPEƒhtmlƒPUBLICƒ
ƒƒ“-//W3C//DTDƒXHTMLƒ1.0ƒTransitional//EN”
XHTML 1.0 frameset
<!DOCTYPEƒhtmlƒPUBLICƒ“-//W3C//DTDƒXHTMLƒ1.0ƒFrameset//EN”
XHTML 1.1
<!DOCTYPEƒhtmlƒPUBLICƒ“-//W3C//DTDƒXHTMLƒ1.1//EN”
XHTML5
<!DOCTYPEƒhtml>
Setting the Document DTD
• To apply the XHTML 1.0 strict DTD, add the following line after the XML declaration:
<!DOCTYPEƒhtmlƒPUBLICƒ“-//W3C//DTDƒXHTMLƒ1.0ƒStrict//EN”
• To apply the XHTML 1.0 transitional DTD, use the following:
<!DOCTYPEƒhtmlƒPUBLICƒ“-//W3C//DTDƒXHTMLƒ1.0ƒTransitional//EN”
• To apply the XHTML 1.0 frameset DTD, use the following:
<!DOCTYPEƒhtmlƒPUBLICƒ“-//W3C//DTDƒXHTMLƒ1.0ƒFrameset//EN”
• For HTML5 or XHTML5 documents, use the following:
<!DOCTYPEƒhtml>
Tom suggests that you associate the Wizard Works Web site with the transitional DTD
for XHTML 1.0. To do that, you'll add the DOCTYPE declaration for XHTML 1.0 tran-
sitional. Because the code for a DOCTYPE declaration can be long and complicated, a
text file with the declarations from Figure 9-11 has been created for you to copy from.