html中doctype的内容

时间:2011-05-01 18:01:45

标签: html doctype

我不理解html中的doctype。

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

请你解释一下这里的含义是什么。

2 个答案:

答案 0 :(得分:6)

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


!DOCTYPE - The document type declaration
HTML - The root element is HTML, the type of document is HTML
PUBLIC - Availability - this is a public doctype
"-//W3C//DTD HTML 4.01//EN" - A formal identifier
"http://www.w3.org/TR/html4/strict.dtd" - URI, here it is the location of the DTD

about.com还有进一步细分。

答案 1 :(得分:1)

该doctype的部分是:

Root element:             HTML
DTD type:                 PUBLIC
Formal Public Identifier: "-//W3C//DTD HTML 4.01//EN"
DTD URL:                  "http://www.w3.org/TR/html4/strict.dtd">

但是,你真的不必知道这一切意味着什么。只需从W3C's recommended list of doctype declarations中选择一个doctype声明。