< XHTML

Introduction

An XHTML DTD describes the allowed syntax and grammar of XHTML markup. Every XHTML document must start with a DTD declaration and a line of code that declares that you are starting to write XHTML code.

This is the mandatory minimum way to start an XHTML document:

<!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">


The Three Document Type Definitions

There are currently three XHTML 1.0 document types:

  • Strict
  • Transitional
  • Frameset

XHTML 1.0 Strict

This is used when the user wants a clean markup, free of presentational clutter. Use this in conjunction with Cascading Style Sheets.

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

XHTML 1.0 Transitional

Use this when taking advantage of XHTML's presentational features and when you want to support browsers that do not understand Cascading Style Sheets. This is the one that is favoured to use amongst developers and is used commonly.

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

XHTML 1.0 Frameset

Use this when you want to use XHTML Frames to partition the browser window into two or more frames.

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

XHTML 1.1

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

XHTML 2.0

XHTML was a working draft, but its development was halted in favour of HTML 5.0. Even though the specification will not be completed, its doctype is:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 2.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml2.dtd">
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.