audreyfeldroy / favicon-cheat-sheet

Obsessive cheat sheet to favicon sizes/types. Please contribute! (Note: this may be in flux as I learn new things about favicon best practices.)
MIT License
9.85k stars 413 forks source link

Contradiction on HTML tag #76

Closed grv87 closed 5 years ago

grv87 commented 5 years ago

it's best for cross-browser compatibility not to use any HTML

vs

Explicitness is best, so we both name it favicon.ico and explicitly specify the tag.

So, should link tag be added or not?

chindraba-work commented 5 years ago

@grv87 Both.

If the site is using only the favicon.ico, that falls under "The Basics" and will work anywhere and the <link> tag is not needed.

If you want to use something else instead, such as mysite.ico or favicon.png, or if you place the file somewhere other the site root, then you MUST use a <link> tag, and it may, or may not, work in older browsers.

If you are providing multiple options, for multiple devices and uses, then you SHOULD still have the favicon.ico in the site root, and include the <link> tag for it in the HTML, along with the tags for the other files. Keeping the old default favicon.ico in the default place, will allow any browser to find it if/when all else fails. The <link> tags help smarter browsers find, and display, what you prefer to show.

grv87 commented 5 years ago

@chindraba-work, thanks for explanation! As you worded, I got it.