为什么doctype不自动关闭 [英] Why isn't doctype self-closing

查看:83
本文介绍了为什么doctype不自动关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

提供了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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆