HTML5 `<link rel="快捷图标"/>`

标签 html favicon

WHATWG document对于 HTML5,rel 属性必须包含以空格分隔的值,然后它给出了一个允许值表。

The attribute's value must be a set of space-separated tokens. The allowed keywords and their meanings...

link 元素的允许关键字列表不包括 shortcut,但包括 icon。所以我正在查看众所周知的标签

<link rel="shortcut icon" href="/favicon.ico" />

并想知道它是否符合 HTML5。我是否应该从整个网站的该标记中删除关键字 shortcut

最佳答案

来自同一个 WHATWG 文档:

For historical reasons, the icon keyword may be preceded by the keyword "shortcut". If the "shortcut" keyword is present, it must be come immediately before the icon keyword and the two keywords must be separated by only a single U+0020 SPACE character.

关于HTML5 `<link rel="快捷图标"/>`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22290504/

相关文章:

python - 将 python 列表传递给 django 模板

javascript - 在使用 ajax 加载页面之前使用旧的 javascript

在浏览器选项卡上设置 HTML 图像

javascript - 如何防止仅针对网站图标的 HTTP 请求?

javascript - 如果所有 TD 都有文本,则将 boolVar 设置为 true,否则将其设置为 false

python - 似乎无法使用 Python 和 Beautiful Soup 将所有信息写入 CSV 文件

html - 让div用动态同级填充父级的高度

javascript - 操作 window.history 会影响 IE11 上的图标

asp.net-mvc-4 - 替换 mvc4 中的图标

javascript - 从图像中裁剪出麦田圈并设置为网站图标