Search code examples
htmlfavicon

is using apple-touch-icon as favicon possible?


I have noticed that HTML5 Boilerplate and dev websites like css-tricks.com use only apple-touch-icon as any reference to favicon, and that image is indeed displayed in a browser. I was not following this topic for a while and am confused to how this works. Is it safe to now only include a touch-icon and will it be displayed in various browsers?


Solution

  • A favicon.ico file is used by the browser automatically if it's in the root directly of your page/app.

    If you want to add a favicon in a different format (e.g. png), of you want to add it from another source (e.g. a subdirectory like /img) or if you want to make the browser load a new version of the file (e.g. favicon.ico?v=2) you use the link tag.

    More info here: Necessary to add link tag for favicon.ico?