XHTML: Mandatory Tags

An XHTML document must have a DOCTYPE declaration, as well as the <html>, <head>, <title>, and <body> elements. (In HTML, you can omit the <html>, <head>, and <body> elements.) The xmlns attribute in the <html> tag must specify the xml namespace for the document. The namespace for XHTML is defined to be http://www.w3.org/1999/xhtml.

This example shows an XHTML document with a minimum of required tags:

<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
 <title>Title of document</title>
</head>

<body>
  some content
</body>

</html>
Back button Table of Contents Next button