首页 > 开发 > HTML > 正文

W3C推荐的 DTDs(文件类型声明)

2020-09-18 22:11:05
字体:
来源:转载
供稿:网友

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
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表