Struggling for Competence

XHTML - What's that all about?

XHTML is a reformulation of HTML as XML. It aims to make a clean separation between document structure and presentation. To make XHTML you have to follow these rules:

Most of these rules are basically saying that the document must be valid xml, but with the added twist of making it work with older browsers. You can check the validity of your XHTML using the W3C validator.

Html, head, title and body are mandatory

In XHTML the html, head, title and body elements are mandatory. So a minimal html document is:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html lang="en" xmlns="" xml:lang="en">
    <title>Controversial Title</title>
    <h1>Interesting Content</h1>

Difference between Strict and Transitional

The strict doctype removes the presentation elements and attributes from the document. In particular the <center>, <font> and <iframe> elements may not be used.

Special Rules

The general rule is that:

There are however an number of special rules: