Can one large size favicon serve all devices and browsers?

后端 未结 3 1862
抹茶落季
抹茶落季 2021-01-18 05:05

All discussion about favicons recommend creating favicons of different sizes to target different clients. See this answer for example: Does a favicon have to be 32x32 or 16x

相关标签:
3条回答
  • 2021-01-18 05:48

    There is no problem with using one large high-resolution icon (in 2017). Browsers and mobile devices with smaller screens made in the last 4 years will automatically scale them down attractively (if not perfectly) as needed.

    The only downside I can find for using one large favicon—and it's a stretch—is that mobile devices with lower resolution screens will download a slightly larger file than is absolutely necessary. We're talking kilobytes here.

    File Size/Loading Time:

    • Even on a 3G connection, the time it takes to download a single 5kb favicon vs a 100kb favicon is negligible. Unless your 200x200 favicon has a much larger file size than the lower resolution versions, it's perfectly okay to just create one high-resolution favicon file and use that for all browsers/devices.

    • This isn't really even a load time issue, because in most cases the favicon would only be downloaded on a mobile browser when it's bookmarked rather than loading with the rest of the page.

    iOS Safari/Android Chrome:

    • I've never personally experienced any issues using a single large favicon image in PNG format. You'd still want to include the Apple Touch Icon code (<link rel="apple-touch-icon" href="/custom_icon.png">) in addition to the normal favicon code, but you can use the same favicon image file.

    • This look at how iOS Safari scales down icons seems to agree that dropping the smaller icon file sizes is completely fine if 100.0% pixel perfection is not needed.

    • I've seen it pointed out on a number of sites (caveat: in threads that are a few years old) that Apple themselves use one large 152x152 favicon for apple.com. The file size is 4.5kb.

    Although Apple uses 152x152 for their Apple Touch Icon, I'd recommend going with a 192x192 favicon image because this resolution is used by Android Chrome.

    TL;DR:

    As far as I can tell, yes, one large size favicon can work on all modern devices and browsers that conform to standards. The difference in favicon file size of a few kilobytes is mostly irrelevant today, thus I cannot find any problems with this approach.

    0 讨论(0)
  • 2021-01-18 05:52

    Some browsers could scale it down; however, IOS currently doesn't support favicons, so it would be completely useless to make one for it. Unless you want to add it into your text file whenever Apple does build the support for it.

    I would recommend going with a 16x16px size, since it has less memory attached to it.

    0 讨论(0)
  • 2021-01-18 06:05

    The question you referred is 3 years old and nowadays I'd (and I usually am) create one, high res favicon and assume browsers would (and from my experience it will) scale it down if needed.

    0 讨论(0)
提交回复
热议问题