XHTML Tutorial–Lesson 1 Part III

Document Type Definition DTD

As we said in the previous lesson, DTD is mandatory for each XHTML document, and we saw the structure for each XHTML document, that consists of DOCTYPE, html, head, title, body. In other words there is three parts that each XHTML document contain,

  • The DOCTYPE definition.
  • The head section.
  • The body section.

Remember: DOCTYPE definition is the first thing to be written in the XHTML document.

Below an example for an XHTML document:

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”






<h1>Welcome To my page!</h1>




  • As we said before, each XHTML document must start with a DOCTYPE definition, that describes the syntax of a web page, and the allowed syntax to be used, In other words it specifies allowed tags to be used in the XHTML document.

There are three kinds of XHTML DOCTYPE, which are: STRICT, TRANSITIONAL, and FRAMESET. We’ll talk about each kind of them and where to use.


<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN”

The strict type of XHTML is a really clean markup language of html, it is free of presentational clutter, and used together with CSS. In other words, this type does not support presentational views for the page, and all design aspects and colors, fonts and styles are left to the CSS.

XHTML 1.0 Transitional

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”

The transitional type is used if you still need XHTML to support presentational features and don’t want to depend completely on the CSS, it is a mix of XHTML and CSS, in fact this type is the commonly used in the web.

XHTML 1.0 Frameset

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Frameset//EN”

The frameset type is used if you want to use html frames.

It’s important to know that the strict type includes elements and attributes that are not obsolete or have not been deprecated or do not appear in the framesets.

On the other hand, the transitional type includes all elements of the strict type plus obsolete and deprecated elements and attributes. It is not preferable to use obsolete or deprecated elements.

Finally, the frameset includes all features and elements in the transitional type plus frames.

To be continued,

To download this lesson as PDF file click here: XHTML Tutorial–Lesson 1 Part III

Best Wishes,

Anas Jaghoub


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s