html5 link rel,HTML5 `<link rel=“shortcut icon” />`

可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):

问题:

The WHATWG document for HTML5 says that the rel attribute must contain values that are space-separated, and then it gives a table of allowed values.

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

The list of allowed keywords for the link element does not include shortcut, but it does include icon. So I'm looking at the all-too-well-known tag

and wondering if it is HTML5-compliant. Should I remove the keyword shortcut from this tag throughout my Website?

回答1:

From the same WHATWG document:

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.

回答2:

Update:

According to this page https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types

The shortcut link type is often seen before icon, but this link type

is non-conforming, ignored and web authors must not use it anymore.

Also, I don't see any references of shortcut in the W3C documentation, so I think it's better to leave it out. https://www.w3schools.com/tags/att_link_rel.asp

回答3:

Although it is still in its experimental stage (because HTML5 dev is ongoing), the

w3.org HTML5 Markup Validator

is a good online tool you can check out. I used it extensively about 6 months ago and it always gave back accurate HTML5 syntax reports.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值