HTML Reference

HTML DOCTYPE

poised solutions
web development
Poised Solutions

HTML DOCTYPE - Document Type Declaration

 
HTML DOCTYPE

An HTML DOCTYPE (Document Type Declaration) is placed at the head of a document, and the DOCTYPE declared indicates to a web browser which render mode to use to display a page. For XHTML documents the DOCTYPE should immediately follow the XML declaration, some browsers have a problem with the XML declaration, so in some cases the XML declaration maybe dropped to allow the page to actually be rendered for some browsers.

HTML and XHTML tend to be the main DOCTYPEs used on the web, but there also exists, MathML (Math Markup Language), SVG (Scalable Vector Graphic) documents, and these documents can be combined together in XHTML using XMLNS (eXtensible Markup Language NameSpaces) with a multi DOCTYPE.


DOCTYPE Quick Reference

DOCTYPE quick references are shown below. the standard DOCTYPE is generally referred to as strict, where deprecated elements are used in the markup transitional is declared, if a frameset is used then frameset types are declared, basic declares a cut down DTD primarily for smaller devices such as PDAs, full is the complete DTD, and tiny, which is smaller than small is for mobile phones.


HTML DOCTYPEs

HTML is the standard markup language used on the web, SGML is the definition language. HTML DOCTYPEs go from 2.0 through to 4.1, version 5 is on the horizon.

HTML 4.01 DOCTYPEs

HTML 4.01 is the latest HTML release, and comes in strict, transitional, and frameset. HTML 4.01 DOCTYPE is the normal DOCTYPE used on most sites recently built, XHTML is gaining some ground, but HTML 4.01 is often seen as a slightly safer option.

HTML 4.01 Strict DOCTYPE

Non legacy sites to be done in HTML should currently use the HTML 4.01 Strict DOCTYPE. The W3C recommendation for HTML 4.01 has been available since 1999.

<!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"
>
HTML 4.01 Transitional DOCTYPE

If a legacy site is to converted over or updated, then the Transitional DOCTYPE should be considered.

<!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"
>
HTML 4.01 Frameset DOCTYPE

If a frameset is being used then the Frameset DOCTYPE should be used.

<!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd"
>
HTML 3.2 DOCTYPE

HTML 3.2 was released in early 1997 and was replaced in 1999. The HTML 3.2 DOCTYPE should only be used on legacy sites, or where it makes sense to do so.

<!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 3.2 Final//EN"
>
HTML 2.0 DOCTYPE

HTML 2.0 was released in 1995 and was replaced in 1999. The HTML 2.0 DOCTYPE should only be used on legacy sites, or where it would make sense to do so.

<!DOCTYPE html PUBLIC
"-//IETF//DTD HTML 2.0//EN"
>

XHTML DOCTYPEs

XHTML is the new web markup language from the W3C, XML is the definition language for XHTML. XHTML DOCTYPEs are 1.0 and 1.1 at the moment.

XHTML 1.1 DOCTYPEs

XHTML 1.1 is the latest XHTML release and comes in basic and just plain vanilla XHTML 1.1. XHTML 1.1 was released in 2001 by W3C.

XHTML 1.1 DOCTYPE

The standard XHTML 1.1 DOCTYPE tends to be used on modern sites where the developer is testing out new technology. Most of the modern major browsers support XHTML 1.1, though there are still a number of older browsers used that may have trouble with the XHTML 1.1 DOCTYPE.

<?xml
version  = "1.0"
encoding = "utf-8"
?>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1//EN" 
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"
>
XHTML 1.1 Basic DOCTYPE

XHTML 1.1 Basic DOCTYPE is designed for mobile phones, PDAs, pagers and set top boxes. XHTML 1.1 Basic DOCTYPE is a cut down XHTML 1.1 DOCTYPE. Basic has replaced the small and tiny types as the distinction between processing power of small devices has been closing.

<?xml
version  = "1.0"
encoding = "utf-8"
?>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML Basic 1.1//EN"
"http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd"
>
XHTML 1.0 DOCTYPEs

XHTML 1.0 was released in 2000 and revised in 2002. XHTML 1.0 is useful for those wishing to produce or move over their sites to XHTML and therefore to subset of XML. XML tools can work better with XHTML, so XHTML makes for a good intranet solution, where the data can be processed by other applications. Care should be taken when when using XHTML as some of the browsers will not render unless the XHTML is valid. XHTML comes in strict, transitional, frameset, and basic.

XHTML 1.0 Strict DOCTYPE

XHTML 1.0 Strict DOCTYPE is more likely to be used if a site is going to be XHTML, though care should be taken to ensure all the documents are well formed.

<?xml
version  = "1.0"
encoding = "utf-8"
?>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
>
XHTML 1.0 Transitional DOCTYPE

XHTML 1.0 Transitional DOCTYPE may be used to convert an HTML site over to XHTML. Care should still be taken that the document is well formed XHTML, but certain deprecated elements are still available which may ease the transition.

<?xml
version  = "1.0"
encoding = "utf-8"
?>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>
XHTML 1.0 Frameset DOCTYPE

XHTML 1.0 Frameset DOCTYPE is used when an XHTML frameset is required.

<?xml
version  = "1.0"
encoding = "utf-8"
?>
<!DOCTYPE htm PUBLIC
"-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"
>
XHTML 1.0 Basic DOCTYPE

XHTML 1.0 Basic DOCTYPE is used for mobiles, PDAs, and small electronic devices. XHTML 1.0 Basic DOCTYPE is a reduced XHTML 1.0 DOCTYPE.

<?xml
version  = "1.0"
encoding = "utf-8"
?>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML Basic 1.0//EN"
"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd"
>

MathML DOCTYPEs

MathML (Math Markup Language) was the first XML based language to be released. MathML DOCTYPE was released in 1998 by the W3C. MathML was designed to express documents that heavily use mathematical notation. MathML DOCTYPE are 1.1 or 2.0 (version 3.0 expected around 2010.

MathML 2.0 DOCTYPE

MathML 2.0 DOCTYPE was released in 2003, a version is on the way though the version was meant as the final release If MathML is to be used version 2.0 is the recommended version.

<?xml
version  = "1.0"
encoding = "utf-8"
?>
<!DOCTYPE math PUBLIC
"-//W3C//DTD MathML 2.0//EN"  
"http://www.w3.org/TR/MathML2/dtd/mathml2.dtd"
>
MathML 1.01 DOCTYPE

MathML 1.01 DOCTYPE was released in 1998, as the first XML language recommendation of the W3C. MathML markup is perhaps a little more verbose than other styles of Maths markup, though the more succinct styles can be converted (Latex to MathML). The main advantage is both Opera and the Geko engines are capable of displaying MathML.

<?xml
version  = "1.0"
encoding = "utf-8"
?>
<!DOCTYPE math SYSTEM 
"http://www.w3.org/Math/DTD/mathml1/mathml.dtd"
>

SVG DOCTYPEs

SVG (Scalable Vector Graphic) DOCTYPE was released in 2001, and SVG is used to describe vector imagery, unlike raster (bitmap) imagery, vector imagery can scale without loosing fidelity. SVG DOCTYPEs are version 1.0 and version 1.1.

SVG 1.1 DOCTYPEs

SVG 1.1 DOCTYPEs were released in 2003 and edited in place in 2009, there are three type of SVG 1.1 DOCTYPEs, full the standard SVG 1.1 DOCTYPE, basic designed for PDAs, and tiny for mobile phones.

SVG 1.1 Full DOCTYPE

The SVG 1.1 Full DOCTYPE is the standard DOCTYPE for SVG. The SVG 1.1 Full DOCTYPE was release in 2003 by the W3C. SVG is used in the Inkscape program to store and manipulate imagery.

<?xml
version  = "1.0"
encoding = "utf-8"
?>
<!DOCTYPE svg PUBLIC
"-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"
>
SVG 1.1 Basic DOCTYPE

SVG 1.1 Basic DOCTYPE is for PDAs, it is a slightly reduced SVG DTD.

<?xml
version  = "1.0"
encoding = "utf-8"
?>
<!DOCTYPE svg PUBLIC
"-//W3C//DTD SVG 1.1 Basic//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd"
>
SVG 1.1 Tiny DOCTYPE

SVG 1.1 Tiny DOCTYPE is intended for mobile phones, it is a reduced SVG DTD.

<?xml
version  = "1.0"
encoding = "utf-8"
?>
<!DOCTYPE svg PUBLIC
"-//W3C//DTD SVG 1.1 Tiny//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd"
>

Multi DOCTYPEs

XMLNS (eXtensible Markup Language NameSpaces) allows for the mixing of XML based documents, e.g. XHTML, SVG, and MathML. A host language can be defined from the mix.

XHTML + MathML + SVG DOCTYPE (XHTML as Host)

XHTML + MathML + SVG DOCTYPE combined, with XHTML as the host language.

<?xml
version  = "1.0"
encoding = "utf-8"
?>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
"http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"
>
XHTML + MathML + SVG DOCTYPE (SVG as Host)

XHTML + MathML + SVG DOCTYPE combined, with SVG as the host language.

<?xml
version  = "1.0"
encoding = "utf-8"
?>
<!DOCTYPE svg:svg PUBLIC
"-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
"http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"
>

Document Type Defintions

Links to Document Type Definitions for HTML, XHTML, SVG and Mathml.

Document Type Definition Links

HTML Reference Site authored by Poised Solutions.
 
HTML

























HTML DeveloperWeb Design
HTML DeveloperWeb Design
Web DevelopmentWeb Client Side LanguagesWebserver Administration
Web DevelopmentWeb Client Side LanguagesWebserver Administration

Poised Solutions IT Practice offers development in a wide range of programming languages, Web Development and Web Design are also offfered.
Poised Solutions HTML Developer for Hire.

Poised Solutions HTML Reference Site Designed and Developed by Poised Solutions