programming and software tutorials
The XHTML DTD (Document Type Definitions)
All XHTML documents have three main parts:
- DOCTYPE declaration
- <head>
- <body>
The DOCTYPE must be defined before anything else in the document.
Everything but the DOCTYPE declaration will look like HTML, XHTML just holds you to a few rules. That’s the beauty of XHTML!
There are three types of DTDs:
- STRICT – This one is my personal favorite. It forces you to use clean markup when writing your web pages. You use CSS to define your presentation.
- TRANSITIONAL – This allows you to mix regular HTML features with XHTML.
- FRAMESET – This allows you to use HTML frames
These are some examples of implementing each DTD.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
| Print article | This entry was posted by Chad Challis on February 14, 2010 at 2:34 pm, and is filed under XHTML. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |