html - </html> 之后是否允许使用 <link> 标记?

标签 html w3c-validation

似乎 HTML5 Recommendation 对 <link> 有一点歧义当前位置:http://www.w3.org/TR/html5/document-metadata.html#the-link-element

有一句话

Contexts in which this element can be used: Where metadata content is expected.

并且没有这个上下文的确切定义。但是整个页面都描述了这种内容,例如头部、标题、基础、链接、元、样式。

还有一段话:

A link element must have a rel attribute. If the rel attribute is used, the element is restricted to the head element.

似乎它有冗余或相互排斥的短语。

所以有人可以通过 <link> 澄清情况吗?标记位置?

Google 关于 https://developers.google.com/speed/docs/insights/OptimizeCSSDelivery#example 的说法是否正确?还是违反了 W3C 推荐标准?

最佳答案

link 不允许在 html 元素之外。 html 元素是唯一允许的根元素。

将元素插入 head 不能将它放在 html 之外,因为 head 也必须在 html 中。

关于html - </html> 之后是否允许使用 <link> 标记?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31383791/

相关文章:

html - 鹈鹕网站生成器 : themes do not have visible table borders?

custom-attributes - 如何使自定义属性 w3 有效?

HTML5 验证错误 : Element source not allowed as a child element of audio in this context

HTML5 有效的命名空间标签前缀

ruby-on-rails - 可以从本地计算机轻松检查 W3C 有效性吗?

w3c-validation - 此时元素输入不允许属性自动更正

javascript - 定义完全独立的样式信息

html - 将第一个文本对齐到图像右侧,然后将第二个文本对齐到图像下方

javascript - 准备文件下载时更改主体上的光标类型

html - 没有 IE 和 Firefox 背景