DOCTYPE Declaration and Document Element

Contact Us or call 1-877-932-8228
DOCTYPE Declaration and Document Element

The DOCTYPE Declaration

There are three DTDs for XHTML: Strict, Transitional, and Frameset. All XHTML documents must conform to the XML syntax rules.

XHTML Strict

XHTML Documents that conform to the Strict DTD may not use any deprecated HTML tags. The DOCTYPE declaration looks like this:

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

XHTML Transitional

XHTML Documents that conform to the Transitional DTD may use deprecated HTML tags, but may not use the <frameset> and <frame> tags. The DOCTYPE declaration looks like this:

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

XHTML Frameset

XHTML Documents that conform to the Frameset DTD may use deprecated HTML tags including the <frameset> and <frame> tags. The DOCTYPE declaration looks like this:

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

The Document Element

In XHTML, the document element (<html>) must contain a namespace declaration as shown below.

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
Next