好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

w3c是怎样规定<meta>标签的到底有没有结束的斜杠?



哪种是更规范的写法

回复内容: 泻药
去查规范

HTML 4
The global structure of an HTML document
Start tag: required , End tag: forbidden


HTML5
4.2 Document metadata
Tag omission in text/html: No end tag.


所以:
第一种写法更贴近规范 这里有一个来自 StackOverflow 的回答,它比较详细地解释了你这个问题:

html - Are self-closing tags valid in HTML5?

In HTML 5 , means , the start tag . It is not a "self-closing tag" . Instead, certain elements are designated as having no end tag , for example
. These are collectively called void elements . The slash is just syntactic sugar for people who are addicted to XML. Using the slash in a non-void element tag is invalid, but browsers parse it as the start tag anyway, leading to a mismatch in end tags. 自闭合标签使用html5的doctype时不用写反斜杠。

查看更多关于w3c是怎样规定<meta>标签的到底有没有结束的斜杠?的详细内容...

  阅读:34次

CopyRight:2016-2025好得很程序员自学网 备案ICP:湘ICP备09009000号-16 http://www.haodehen.cn
本站资讯不构成任何建议,仅限于个人分享,参考须谨慎!
本网站对有关资料所引致的错误、不确或遗漏,概不负任何法律责任。
本网站刊载的所有内容(包括但不仅限文字、图片、LOGO、音频、视频、软件、程序等)版权归原作者所有。任何单位或个人认为本网站中的内容可能涉嫌侵犯其知识产权或存在不实内容时,请及时通知本站,予以删除。

网站内容来源于网络分享,如有侵权发邮箱到:kenbest@126.com,收到邮件我们会即时下线处理。
网站框架支持:HDHCMS   51LA统计 百度统计
Copyright © 2018-2025 「好得很程序员自学网
[ SiteMap ]