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
ƒƒ“ http://www.w3.org/TR/html4/strict.dtd”>
HTML 4.01 transitional <!DOCTYPEƒhtmlƒPUBLICƒ
ƒƒ“-//W3C//DTDƒHTMLƒ4.01ƒTransitional//EN”
ƒƒ“ http://www.w3.org/TR/html4/loose.dtd”>
HTML 4.01 frameset <!DOCTYPEƒhtmlƒPUBLICƒ“-//W3C//DTDƒHTMLƒ4.01ƒFrameset//EN”
ƒƒ“ http://www.w3.org/TR/html4/frameset.dtd”>
HTML5 <!DOCTYPEƒhtml>
XHTML 1.0 strict <!DOCTYPEƒhtmlƒPUBLICƒ“-//W3C//DTDƒXHTMLƒ1.0ƒStrict//EN”
ƒƒ“ http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
XHTML 1.0 transitional <!DOCTYPEƒhtmlƒPUBLICƒ
ƒƒ“-//W3C//DTDƒXHTMLƒ1.0ƒTransitional//EN”
ƒƒ“ http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
XHTML 1.0 frameset
<!DOCTYPEƒhtmlƒPUBLICƒ“-//W3C//DTDƒXHTMLƒ1.0ƒFrameset//EN”
ƒƒ“ http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd”>
XHTML 1.1
<!DOCTYPEƒhtmlƒPUBLICƒ“-//W3C//DTDƒXHTMLƒ1.1//EN”
ƒƒ“ http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd”>
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”
ƒƒ“ http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
• To apply the XHTML 1.0 transitional DTD, use the following:
<!DOCTYPEƒhtmlƒPUBLICƒ“-//W3C//DTDƒXHTMLƒ1.0ƒTransitional//EN”
ƒƒ“ http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
• To apply the XHTML 1.0 frameset DTD, use the following:
<!DOCTYPEƒhtmlƒPUBLICƒ“-//W3C//DTDƒXHTMLƒ1.0ƒFrameset//EN”
ƒƒ“ http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd”>
• 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.
Search WWH ::




Custom Search