Mobile Favicons

Rafaël De Jongh picture Rafaël De Jongh · Jun 14, 2015 · Viewed 15.5k times · Source

So I'm doing some research regarding mobile site user experience and stumbled upon the fact of the whole favicon.ico being completely outdated and all.

Looking around I've gathered that I require various new sets of images/icons to actually present the "favicon" properly on various mobile devices like android, iphones and windows phones.

Now the question here is, I've got the following code:

<link rel="apple-touch-icon" sizes="57x57" href="images/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="images/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="images/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="images/favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="images/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="images/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="images/favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="images/favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="images/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="images/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="images/favicons/favicon-194x194.png" sizes="194x194">
<link rel="icon" type="image/png" href="images/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="images/favicons/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="images/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="images/favicons/manifest.json">
<meta name="apple-mobile-web-app-title" content="JoJo Productions">
<meta name="application-name" content="JoJo Productions">
<meta name="msapplication-TileColor" content="#00aba9">
<meta name="msapplication-TileImage" content="images/favicons/mstile-144x144.png">
<meta name="msapplication-config" content="images/favicons/browserconfig.xml">
<meta name="theme-color" content="#555555">
<link rel="shortcut icon" href="favicon.ico">

but for me this is just a too huge chunk of code to just show the favicon properly. So I was wondering what I would be able to remove and what I should definitely keep to present it properly on "most" mobile devices.

Most other websites that make use of mobile favicons only use a handful of the above mentioned code, being the: 57x57, 72x72, 114x114 and the 144x144 this all being the apple-touch-icons. So are the images/code parts really that important for Iphone or other mobile users? Or is it possible to have it a bit more optimised?

Either way thanks for the information.


Edit

So with some further research I've gotten to this result which seems to work okay on most modern devices:

<meta name="msapplication-config" content="images/favicons/browserconfig.xml">
<meta name="msapplication-TileImage" content="images/favicons/mstile-large.png">
<meta name="msapplication-TileColor" content="#ae8160">
<meta name="application-name" content="JoJo Productions">
<link rel="shortcut icon" sizes="16x16 24x24 32x32 48x48" href="favicon.ico">
<link rel="icon" type="image/png" sizes="32x32" href="favicon.png">
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">

Which is of course better for me as the amount of code/images has been decreased significantly. And as long as it works on most modern mobile devices I'm happy.

With a combination of this "cheat sheet", this tutorial, and the help from Philippe B. I managed to get it to this.

Either way thanks for all the help and hopefully in the coming years they'll make a proper standard for the favicon!

Answer

philippe_b picture philippe_b · Jun 15, 2015

To address as many platforms as possible without a large set of icons, you basically need four icons:

  • A PNG icon, for modern, desktop browsers.
  • An Apple Touch icon for mobile browsers (iOS Safari of course, but also Android Chrome and many others; and also Mac OS Yosemite Safari).
  • favicon.ico, for legacy browsers (think IE 9, 8, ...).
  • A tile icon for IE on Windows 8 and 10.

This gives us:

<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" href="/favicon.png" sizes="32x32">
<link rel="shortcut icon" href="/favicon.ico">
<meta name="msapplication-TileImage" content="/mstile-144x144.png">
<meta name="msapplication-TileColor" content="#00aba9">

A few comments about this code:

  • apple-touch-icon.png is 180x180, which is the highest supported resolution by iOS (iOS 8 on iPhone 6+ and Retina iPad). Lesser platforms will scale the icon down.
  • apple-touch-icon.png is named this way and placed in the root directory of the web site because this is a convention from Apple. If you place it or name it differently, you will probably notice 404 errors in your server's logs. Nothing to worry but if you can avoid them...
  • favicon.png is 32x32. Not too small and not too large. You might make it large, but for no significant benefits.
  • favicon.ico is in the root directory of your web site because this is a convention from IE. For example, Yandex search engine expects it here.
  • In this example, I used mstile-144x144.png and no browserconfig.xml. I did this because it looks easier (this is just two lines of HTML and a picture; no extra XML file involved). But this choice is arguable. The msapplication-TileImag and msapplication-TileColor metas introduced by Win 8.0 / IE 10 have been replaced by browserconfig.xml in Win 8.1 / IE 11. So browserconfig.xml is a longer term solution. Plus, if you put this file in the root directory of your site, you don't have to declare it in the HTML: IE 11 will find it by convention ("favicon.ico" style). Note that Coast by Opera picks msapplication-TileImag for bookmarks. Now make your choice!

A final note: the large code chunk you quote in your question was generated by RealFaviconGenerator. As the author of this tool, your question makes me sad ;-)