似乎 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/