Favicon standard - 2019 - SVG, ICO, PNG and sizes?

What sizes favicon, file formats and meta / link tags should be used since 2019? This includes the apple icon, Windows, Android and other devices that people use today.

I use Opera and I see that it supports the SVG format. Is this the best solution to use SVG now? Is there a "one file fits all" option?

I browsed through many websites and checked out various "favicon generators". They are all years old and work mainly with PNG files.

Example: Which code should ico and svg use?

<link rel="icon" href="favicon.ico" type="image/ico"> <link rel="icon" href="favicon.svg" type="image/svg+xml"> 

or should sizes be indicated if ico contains more sizes? I did not find a single good answer.

 <link rel="icon" sizes="16x16 24x24 32x32 48x48 64x64" href="favicon.ico"> 

Please indicate the sizes, file formats and meta / link tags of which icons should be used.

+70
source share
2 answers

Disclaimer: I am the author of RealFaviconGenerator, which I expect will be up to date (mostly see below). So don't be surprised if this answer matches what RFG generates.

The One-Size Myth for All

There is no one size fits all icon. You cannot create a single SVG icon and expect it to work everywhere.

From a technical point of view, a single SVG icon would be a good thing. But from the point of view of the user interface and UX, this is an undesirable result. Compare iOS and Android. In iOS, all home screen icons are rounded squares ( iOS fills the transparent areas of the Touch icons with black ). On Android, home screen icons often use non-square shapes and transparency (including Google application icons). Submit one touch icon and Android Chrome will use it. But you will not be able to comply with the rules for Android icons , while a highlighted icon may.

Therefore, I advise you to consciously avoid using a single icon. It is better to focus on each platform separately when possible (this is not always the case).

Icons, platform for each platform

iOS Safari

iOS Safari expects a touch icon . Today this is a PNG image of 180x180 size. This image should not use transparency, and its corners will automatically be rounded when added to the main screen. Declared using:

 <link rel="apple-touch-icon" sizes="180x180" href="/icons/apple-touch-icon.png"> 

Over the years, this icon has become the "default high resolution icon" for many browsers. So you will find it elsewhere, when bookmarked, etc.

Android Chrome

Android Chrome uses the manifest of the web application . Although this manifesto is not dedicated to Android Chrome, it is currently its main proponent. Therefore, at present, you can still read the icons from the Manifesto of the Android Chrome web application.

As the name suggests, the web application manifest is for web applications. But any website can use it as a link to some icons.

Android expects the PNG icon 192x192, transparency is allowed and encouraged.

The manifest is declared using:

 <link rel="manifest" href="/icons/site.webmanifest"> 

Edge and IE 12

Microsoft introduced browserconfig , an XML document that lists various icons that correspond to the Metro interface.

The file and background color are declared using:

 <meta name="msapplication-TileColor" content="#da532c"> <meta name="msapplication-config" content="/icons/browserconfig.xml"> 

Classic desktop browsers

Windows / macOS Chrome, Windows / macOS Firefox, Safari, IE ... It was a bit blurry. Historically, there was one favicon.ico file that is still supported. However, most modern browsers prefer PNG icons, which are easier. In addition, some browsers cannot select the correct icon in the ICO file (this format may include several versions of the icon), which leads to incorrect use of the low-resolution icon.

One might be tempted to completely abandon the old favicon.ico . Although I would like to make this jump in RFG, I did not run the necessary tests to evaluate the impact on older browsers.

So the combo that I still recommend today with favicon.ico embeds 16x16, 32x32 and 48x48 icons:

 <link rel="icon" type="image/png" sizes="32x32" href="/icons/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="16x16" href="/icons/favicon-16x16.png"> <link rel="shortcut icon" href="/icons/favicon.ico"> 

Other browsers

Other browsers may have highlighted icons. For example, Coast by Opera is looking for the 228x228 icon . The need to focus on these browsers is not obvious. Usually they use a touch icon or other icons when they cannot find their own icon.

Conclusion

As announced at the beginning, this is exactly what RealFaviconGenerator creates.

+134
source

It is also worth mentioning that along with favicon, you should add some other tags, such as OG tags, Twitter cards, or an MS application. All this serves the same purpose - the visual identification of your brand and should also be included.

Twitter card can be found HERE

I add the following tags

 <meta name="twitter:card" content="summary_large_image"> <meta name="twitter:site" content="@YourAccount"> <meta name="twitter:creator" content="@YourAccount"> <meta name="twitter:title" content="Title of your page"> <meta name="twitter:url" content="URL of your page"> <meta name="twitter:description" content="Your description here"> <meta name="twitter:image:src" content="URL of image"> 

I found that many users make 1300px 650px and jpg / png images.

After adding all tags, they must be checked HERE


Facebook OG has more features, but overall they are:

 <meta property="og:title" content="ENTER PAGE TITLE"> <meta property="og:type" content="website"><!--Different values possible --> <meta property="og:url" content="ENTER PAGE URL"> <meta property="og:image" content="URL OF IMAGE"> <meta property="og:image:width" content="1240"> <meta property="og:image:height" content="650"> <meta property="og:site_name" content="ENTER YOUR SITE NAME"> <meta property="og:description" content="ENTER YOUR PAGE DESCRIPTION"> <meta property="fb:app_id" content="ENTER YOUR FB APP ID"> <meta property="og:see_also" content="URL to recommended page number 1"> <meta property="og:see_also" content="URL to recommended page number 2"> <!--UP TO 5 WEBSITE ADRESSES --> 

Facebook recommends a specific image ratio and file size limited to 8 MB. To save similar images with a twitter card, I recommend 1240 by 650 pixels and jpg / png format. Facebook and Twitter do not accept svg ...


I have found that some global brands use this tag on their sites. One had dimensions of 150x150 pixels and PNG format. This image can be used by browsers to display in search results.

 <meta name="thumbnail" content="path/to/image/thumb-150x150.png"> 

Real Favicon Generator also covers Microsoft badges. There are many other meta tags for the MS application to optimize the page, and other information, such as an image, is displayed. This topic is also worth reading.

I hope this is useful to someone and extends the theme of branding your site.

+7
source

Source: https://habr.com/ru/post/1275552/


All Articles