当前位置: 首页 > 图文教程 > 网页制作 > HTML/XHTML教程 > W3C推荐的 DTDs(文件类型声明)

HTML/XHTML教程
网页页面 自动刷新的3种代码
网页制作 TD也可以溢出隐藏显示
网页设计 TabIndex元素
HTML非常用标签 optgroup、sub、sup和bdo示例代码
html超级链接标记A的TARGET属性详解
语义化的网页 XHTML语义化标记
各种MOUSE鼠标形状的表示方法
左右移动转换文字特效HTML代码解析
IE6的BUG及修复 谓防患于未然的策略
编写email邮件的HTML页面原则小结
熟手的html编写风格与原因分析
常见的HTML标记错误写法
html 块级标签与内联标签的区别
IE6的BUG及修复:谓防患于未然的策略
制作编写HTML邮件的编写原则
HTML Symbol Entities美化网页小图标
HTML代码编写的常用5个原则以及原因
HTML基础教程:常见的HTML标记错误写法
经验分享:淘宝网店网页标题优化和宝贝橱窗推荐
W3C验证XHTML常见的5个错误

HTML/XHTML教程 中的 W3C推荐的 DTDs(文件类型声明)


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-28   浏览: 33 ::
收藏到网摘: n/a

When authoring document is HTML or XHTML, it is important to Add a Doctype declaration. The 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 declarations that you can use in your Web documents.

Template

Use the following markup as a template to create a new XHTML 1.0 document using a proper DOCTYPE. See the list below if you wish to use another document type.

<?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">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>	<title>An XHTML 1.0 Strict standard template</title>	<meta http-equiv="content-type"	content="text/html;charset=utf-8" />	<meta http-equiv="Content-Style-Type" content="text/css" />
</head>
<body> <p>… Your HTML content here …</p>
</body>
</html>

DTD List

HTML 4.01 - Strict, Transitional, Frameset:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">	
XHTML 1.0 - Strict, Transitional, Frameset:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!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.0 - DTD:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">	
XHTML Basic 1.1 - DTD:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">	
HTML 2.0 - DTD:
<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">
HTML 3.2 - DTD:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
MathML 1.01 - DTD:
<!DOCTYPE math SYSTEM	"http://www.w3.org/Math/DTD/mathml1/mathml.dtd">	
MathML 2.0 - DTD:
<!DOCTYPE math PUBLIC "-//W3C//DTD MathML 2.0//EN"	"http://www.w3.org/TR/MathML2/dtd/mathml2.dtd">	
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">	
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 Full - DTD:
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"	"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.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">	
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">	

List of DTDs for the CSS validator.

Authoring tools MUST NOT use the following list.

HTML 4.0
http://www.w3.org/TR/1998/REC-html40-19980424/strict.dtd
http://www.w3.org/TR/1998/REC-html40-19980424/loose.dtd
http://www.w3.org/TR/1998/REC-html40-19980424/frameset.dtd
HTML 4.01
http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd
http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd
http://www.w3.org/TR/1999/REC-html401-19991224/frameset.dtd
XHTML 1.0
http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-strict.dtd
http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd
http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-frameset.dtd
XHTML 1.1
http://www.w3.org/TR/2001/REC-xhtml11-20010531/DTD/xhtml11.dtd