Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML5 `<link rel="shortcut icon" />`

Tags:

html

favicon

rel

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 attribute'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

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

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

like image 741
chharvey Avatar asked Nov 03 '12 16:11

chharvey


People also ask

What is link rel shortcut icon?

The rel attribute contains values that are space-separated. And according to MDN: 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.

What is rel attribute in HTML?

The rel attribute specifies the relationship between the current document and the linked document. Only used if the href attribute is present. Tip: Search engines can use this attribute to get more information about a link!


2 Answers

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.

like image 181
Alohci Avatar answered Sep 16 '22 12:09

Alohci


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 W3Schools documentation, so I think it's better to leave it out. https://www.w3schools.com/tags/att_link_rel.asp

like image 35
Pablo Santamaria Avatar answered Sep 20 '22 12:09

Pablo Santamaria