DHTMLdev.com — Dedicated to quality Web development articles and tutorials
The Lowdown on HTML DTDs and DOCTYPEs PDF Print E-mail
Saturday, 25 March 2006
Article Index
The Lowdown on HTML DTDs and DOCTYPEs
An Example DTD
How Does This Relate to XML
The XHTML DTD: a Hybrid and XML and HTML
Taking Advantage of DOCTYPE
Conclusion: Additional Reading

Ever wondered where all the HTML tags we use are defined? Why there is a <p> tag instead of <para>? And why a <table> tag requires a <tr> tag, which requires a <td> tag? Have you ever wondered what that DOCTYPE line is at the top of an HTML file? If you have a hankering for understanding DTDs, this one is for you.

What is this line at the top of some HTML pages?

That particular DOCTYPE statement specifies that the HTML page uses the HTML 4.01 Loose DTD. Here is another example, which specifies that an HTML document would use the XHTML 1.0 Transitional DTD.

So What is a DTD?

The tags in the HTML language must be defined somewhere, right? They are defined in the DTD, which stands for Document Type Definition. In a DTD for HTML, all the HTML tags are defined. Everything is defined in the DTD -- the tags, the attributes, the possible values they can hold. Think of the DTD as the HTML tag dictionary: it lists all the tags, what they mean, and how they relate to each other.

Also, there are different DTDs because there are different versions of HTML:

  • HTML 4.01 Strict
  • HTML 4.01 Transitional
  • XHTML 1.0 Strict
  • XHTML 1.0 Transitional
  • and several more.


Last Updated ( Sunday, 26 March 2006 )
 
< Prev   Next >