Search code examples
htmlfavicon

Is necessary to add the resolutions when setting up a favicon?


here I go: About a week ago I added a favicon to a mobile web site guided thru a tutorial, below you will see my html for the mobile site

<link rel="icon" type="image/png" href="/img/logos/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="/img/logos/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="/img/logos/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="/img/logos/favicon-16x16.png" sizes="16x16">

now, I am doing the same but in desktop site, I added this

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

and so far is working, but, my question is: for better results do I need to add any kind of resolution tags like sizes or something like that? Am I missing something here?


Solution

  • This is explained in the spec:

    The sizes attribute gives the sizes of icons for visual media. Its value, if present, is merely advisory. User agents may use the value to decide which icon(s) to use if multiple icons are available.

    So no, it is not necessary, but may be useful.