html – 使空格字符限制可选

html – 使空格字符限制可选,第1张

概述HTML5参考 states: A head element’s end tag may be omitted if the head element is not immediately followed by a space character or a comment. 这种“空间特征”限制意味着什么?我只能想到类似的东西 <title>My Page</title><p>Some stuf HTML5参考 states:

A head element’s end tag may be omitted if the head element is not
immediately followed by a space character or a comment.

这种“空间特征”限制意味着什么?我只能想到类似的东西

<Title>My Page</Title><p>Some stuff.</p>

是有效的,而

<Title>My Page</Title><p>Some stuff.</p>

不是,因为隐含的< / head>< body>标签不会包围换行符.但我觉得我不合时宜.一个澄清的例子将不胜感激.

谢谢大家!

解决方法 它只是意味着由于注释和空格字符可能出现在head元素内部,因此它们不会隐式地结束head元素.

因此,如果你想在head元素关闭之后想要注释(例如),而不是在它关闭之前,那么你必须使用一个明确的< / head>

</Title> <!-- foo --> <body>

意思是一样的

</Title> <!-- foo --> </head><body>

并且无法表达

</Title></head> <!-- foo --> <body>

没有使用明确的< / head>

总结

以上是内存溢出为你收集整理的html – 使空格字符限制可选全部内容,希望文章能够帮你解决html – 使空格字符限制可选所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1077202.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-26
下一篇 2022-05-26

发表评论

登录后才能评论

评论列表(0条)

保存