Вы находитесь на странице: 1из 5

19/9/2016 W3C QA - Recommended list of Doctype declarations you can use in your Web document

Recommended list of Doctype


declarations
[QA Home] Documents Tools Feedback   Search  

Recommended Doctype Declarations to use Warning


in your Web document.
The list is informative
When authoring document is HTML or XHTML, it is and does not try to be
important to Add a Doctype declaration. This makes exhaustive (there are
sure the document will be parsed the same way by many other proper
different browsers. declarations you could
use), but it has most of
The simplest and most reliable doctype declaration the declarations
to use is the one defined in HTML5: commonly used on the
Web at the moment.
<!DOCTYPE html>

If you need a doctype matching a specific version of (X)HTML, the doctype


declaration must be exact (both in spelling and in case) to have the desired
effect, which makes it sometimes difficult. To ease the work, below is a list
of recommended doctype declarations that you can use in your Web
documents.

Template

Use the following markup as a template to create a new HTML document using
a proper Doctype declaration. See the list below if you wish to use another
DTD.

<!DOCTYPE html>
<html>

<head>
<title>An HTML standard template</title>
<meta charset="utf-8" />
</head>

<body>

<p>… Your HTML content here …</p>

</body>
</html>

(X)HTML Doctype Declarations List

HTML5 and beyond


<!DOCTYPE HTML>
https://www.w3.org/QA/2002/04/valid-dtd-list.html 1/5
19/9/2016 W3C QA - Recommended list of Doctype declarations you can use in your Web document

HTML 4.01

Strict
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
4.01//EN"

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

"http://www.w3.org/TR/html4/frameset.dtd">

XHTML 1.0

Strict (quick reference)


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML
1.0 Strict//EN"

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

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

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-
frameset.dtd">

XHTML 1.1 - DTD:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML
1.1//EN"

"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

XHTML Basic 1.1 (quick reference):


https://www.w3.org/QA/2002/04/valid-dtd-list.html 2/5
19/9/2016 W3C QA - Recommended list of Doctype declarations you can use in your Web document

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic


1.1//EN"
"http://www.w3.org/TR/xhtml-basic/xhtml-
basic11.dtd">

MathML Doctype Declarations

MathML 2.0 - DTD:


<!DOCTYPE math PUBLIC "-//W3C//DTD MathML
2.0//EN"

"http://www.w3.org/Math/DTD/mathml2/mathml2.dtd">

MathML 1.01 - DTD:


<!DOCTYPE math SYSTEM

"http://www.w3.org/Math/DTD/mathml1/mathml.dtd">

Compound documents doctype declarations

XHTML + MathML + SVG - DTD:


<!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 Profile (XHTML as the host language) - DTD:


<!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 Profile (Using SVG as the host) - DTD:


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

https://www.w3.org/QA/2002/04/valid-dtd-list.html 3/5
19/9/2016 W3C QA - Recommended list of Doctype declarations you can use in your Web document

Optional doctype declarations

Beyond the specificities of (X)HTML processing, Doctype declarations in XML


languages are only useful to declare named entities and to facilitate the
validation of documents based on DTDs. This means that in many XML
languages, doctype declarations are not necessarily useful.

The list below is provided only if you actually need to declare a doctype for
these types of documents.

SVG 1.1 Full - DTD:


<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"

"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">

SVG 1.0 - DTD:


<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
"http://www.w3.org/TR/2001/REC-SVG-
20010904/DTD/svg10.dtd">

SVG 1.1 Basic - DTD:


<!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 - DTD:


<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1
Tiny//EN"

"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-
tiny.dtd">

Historical doctype declarations

The doctype declarations below are valid, but have mostly an historical value
— a doctype declaration of a more recent equivalent ought to be used in their
stead.

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

https://www.w3.org/QA/2002/04/valid-dtd-list.html 4/5
19/9/2016 W3C QA - Recommended list of Doctype declarations you can use in your Web document

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2


Final//EN">
XHTML Basic 1.0 - DTD:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic
1.0//EN"
"http://www.w3.org/TR/xhtml-basic/xhtml-
basic10.dtd">

Send us Feedback
Last updated: $Date: 2016/07/01 13:20:56 $ by $Author: dom $

COPYRIGHT © 1994-2006 W3C® (MIT, ERCIM, KEIO), ALL RIGHTS RESERVED. W3C
LIABILITY, TRADEMARK, DOCUMENT USE AND SOFTWARE LICENSING RULES APPLY.
YOUR INTERACTIONS WITH THIS SITE ARE IN ACCORDANCE WITH OUR PUBLIC AND
MEMBER PRIVACY STATEMENTS.

https://www.w3.org/QA/2002/04/valid-dtd-list.html 5/5

Вам также может понравиться