这是一个普遍的问题,我的教授们都无法回答:
为什么在HTML中不需要关闭<!Doctype>
标签呢?
每个其他的标签都需要关闭,例如<head></head>
或者<html></html>
!
那么为什么<!Doctype>
不需要关闭呢?
这是一个普遍的问题,我的教授们都无法回答:
为什么在HTML中不需要关闭<!Doctype>
标签呢?
每个其他的标签都需要关闭,例如<head></head>
或者<html></html>
!
那么为什么<!Doctype>
不需要关闭呢?
<p>
) and closing an element (like <p>foo</p>
) are two different things. The >
closes a tag. Elements do not always need explicit end tags, since the end can be inferred by various rules; only XHTML requires explicit end tags for all elements (if we count a “self-closing” tag like <br/>
as both a start tag and an end tag, as it is). But for this doctype thing, no end needs to be indicated or inferred, except the ending >
of the declaration.