XHTML DTD


The XHTML standard defines three Document Type Definitions. The most common is the XHTML Transitional.

<!DOCTYPE> Is Mandatory.
An XHTML document consists of three main parts:
  • the DOCTYPE,
  • the Head, and
  • the Body.
1<!DOCTYPE ...>
2 <html>
3  <head>
4   <title>... </title>
5  </head>
6  <body> ... </body>
7</html>

The basic document structure is given on the above. The DOCTYPE declaration should always be the first line in an XHTML document.

An XHTML Example
This is a simple (minimal) XHTML document:

1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3<html>
4 <head><title>simple document</title></head>
5 <body><p>a simple paragraph</p></body>
6</html>

The DOCTYPE declaration defines the document type:

1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

The rest of the document looks like HTML:
1<html>
2 <head><title>simple document</title></head>
3 <body><p>a simple paragraph</p></body>
4</html>


Demonstration
The following demonstration shows how the script of HTML is displayed on the Web.