The Document Type tag: <!DOCTYPE>

The Document Type declaration is the very first thing in an HTML document, even before the <html> tag. This tag tells the browser which language specification the document uses.

HTML

HTML 4.01 specifies three document types: Strict, Transitional, and Frameset.

HTML Strict DTD

Use this together with Cascading Stylesheets (CSS) to produce clean markup, free of presentational clutter:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

HTML Transitional DTD

The Transitional type includes presentation attributes and elements that W3C plans to move to a style sheet. This allows you to use HTML's presentational features when visitors don't have browsers that support CSS:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

Frameset DTD

Use this for documents containing frames. Frameset DTD is the same as Transitional DTD except that it uses the frameset element instead of the body element:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">

XHTML

XHTML 1.0 also specifies three document types for XML: Strict, Transitional, and Frameset.

XHTML Strict DTD

Use this together with CSS to produce clean markup, free of presentational clutter:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

XHTML Transitional DTD

Use this type in order to use XHTML's presentational features when visitors don't have browsers that support CSS:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

XHTML Frameset DTD

Use this type if you need to use frames. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

Attributes:

None