为什么doctype不自动关闭 [英] Why isn't doctype self-closing
问题描述
提供了xhtml文档类型,如<!DOCTYPE html PUBLIC-// W3C // DTD XHTML 1.1 // EN http://www.w3.org/TR/xhtml11/DTD /xhtml11.dtd\">
,为什么允许此标签本身为非自动关闭/完全不关闭?
Provided an xhtml doctype like <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
, why is this tag itself allowed to be non self-closing / non closing at all?
Aka 为什么不是这样:<!DOCTYPE html PUBLIC-// W3C // DTD XHTML 1.1 // EN http://www.w3.org/TR /xhtml11/DTD/xhtml11.dtd />
推荐答案
这不是标记(元素)。这是一个声明,它是声明的语法(文档类型声明一个>)。
It's not a tag (element). It's a declaration and that is the syntax for a declaration (doctype declaration specifically).
其他声明( ELEMENT
, ENTITY
, ATTLIST
等)具有类似的语法。 >
关闭声明。
Other declarations (ELEMENT
, ENTITY
, ATTLIST
, etc.) have a similar syntax. The >
closes the declaration.
这篇关于为什么doctype不自动关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!