favicon 尺寸问题

Favicon dimensions

最近更新网站的 favicon.ico 图标文件,需要美女设计师重新设计图标,那么需要设计什么尺寸的图标呢?有没有固定的标准?

百度上的解释是
在这里插入图片描述
又查了下其他的资料
在这里插入图片描述

在栈溢出找到了详细的解释:https://stackoverflow.com/questions/2268204/favicon-dimensions
在这里插入图片描述

I have a favicon with the dimensions of height=26px / width=20px named favicon.png

<link href=http://www.example.com/images/favicon.png rel="shortcut icon" />

Question: Is my favicon.png supposed to be a particular size? Also, can I use a non-standard size/dimension and if so, how?

答案

favicon 图标支持 16-32-48 像素的 ICO 图片。ICO 格式的图片与PNG格式的图片不同。这里需要一个方形的图片。原始答案建议大家使用一个生成器自动生成favicon图标(http://realfavicongenerator.net/))。

The favicon is supposed to be a set of 16x16, 32x32 and 48x48 pictures in ICO format. ICO format is different than PNG. Non-square pictures are not supported.To generate the favicon, for many reasons explained below, I advise you to use this favicon generator. Full disclosure: I’m the author of this site.

综合分析

favicon 必须是正方形(height===width)桌面浏览器和IOS不支持其他形状的图标。图标的格式可以使ico或者是png格式。下面是两种类型的图标的比较。

Favicon must be square. Desktop browsers and Apple iOS do not support non-square icons.

The favicon is supported by several files:

  • A favicon.ico icon.
  • Some other PNG icons.

In order to get the best results across desktop browsers (Windows/IE, MacOS/Safari, etc.), you need to combine both types of icons.

favicon.ico

尽管所有的浏览器都支持ICO文件图标,这个文件类型主要支持早期的IE浏览器。ICO格式不同于png格式。因为一些智能浏览器可以很好的转化PNG图片,即使这些图片使用被错误的重命名为ICO后缀。一个ICO文件可以包含几个图片,微软推使用16×16或者 32×32的尺寸,例如,在地址栏中的图片是16像素的,在任务栏中的快捷方式是32像素的。

Although all desktop browsers can deal with this icon, it is primarily for older version of IE.

The ICO format is different of the PNG format. This point is tricky because some browsers are smart enough to process a PNG picture correctly, even when it was wrongly renamed with an ICO extension.

An ICO file can contain several pictures and Microsoft recommends to put 16x16, 32x32 and 48x48 versions of the icon in favicon.ico. For example, IE will use the 16x16 version for the address bar, and the 32x32 for a task bar shortcut.

使用下面的语句声明图标,并把图标放在根目录下面,不推荐让浏览器自动寻找png图标。

Declare the favicon with:

<link rel="icon" href="/path/to/icons/favicon.ico">

However, it is recommended to place favicon.ico in the root directory of the web site and to not declare it at all and let the modern browsers pick the PNG icons.

PNG icons

新版IE浏览器和chrome-FF浏览器都推荐使用PNG格式,尺寸从16-32不等。例如,Safari可以使用最大196的图标

Modern desktop browsers (IE11, recent versions of Chrome, Firefox…) prefer to use PNG icons. The usual expected sizes are 16x16, 32x32 and “as big as possible”. For example, MacOS/Safari uses the 196x196 icon if it is the biggest it can find.

下面详细介绍了不同设备不同浏览器推荐的尺寸

What are the recommended sizes? Pick your favorite platforms:

可以声明多个路径

The PNG icons are declared with:

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

注意:FF不支持sizes属性,会使用最后的PNG图片,所以确保最后的是 32 像素的图片。并且在FF中可以防止瞎子啊一个不需要的大图片。

Beware: Firefox does not support the sizes attribute and uses the last PNG icon it finds. Make sure to declare the 32x32 picture last: it is good enough for Firefox, and that will prevent it from downloading a big picture it does not need.

Chrome不支持sizes属性,会下载所有的声明的图标,所以最好不要声明太多的图标。

Also note that Chrome does not support the sizes attribute and tends to load all declared icons. Better not declare too many icons.

Mobile platforms

This question is about desktop favicon so there is no need to delve too much in this topic.

Apple defines touch icon for the iOS platform. iOS does not support non-square icon. It simply rescales non-square pictures to make them square (look for the Kioskea example).

Android Chrome relies on the Apple touch icon and also defines a 192x192 PNG icon.

Microsoft defines the tile picture and the browserconfig.xml file.

Conclusion

Generating a favicon that works everywhere is quite complex. I advise you to use this favicon generator. Full disclosure: I’m the author of this site.

结论:生成一个可以在任何浏览器可以很好使用的favicon是很复杂的,原作者建议使用自己的图标生成器。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: Favicon图标大全是一个收集了各种网站和应用程序常用的图标的资源集合。Favicon是网站或应用程序的标志性图标,通常显示在网页浏览器的标签栏和收藏夹中,用来增加网站的可识别性和品牌形象。 Favicon图标大全提供了大量的不同种类和风格的图标选择,包括各种颜色、形状和设计风格。用户可以根据自己的需要选择和下载适合自己网站或应用程序的图标。这些图标集合一般分为免费和付费两个版本,用户可以根据自己的预算和需求选择合适的版本。 使用Favicon图标大全可以带来一些好处。首先,通过选择一个符合自己网站或应用程序风格的图标,可以增强用户对品牌的认知和记忆,提升用户体验。其次,图标大全中的图标都是经过精心设计的,具有高质量和美观的特点,能够为网站或应用程序增加一份专业和时尚的元素。再者,使用Favicon图标大全提供的图标可以节省用户自己设计或寻找图标的时间和精力,同时降低因使用未经授权的图标而导致的法律风险。 总之,Favicon图标大全是一个方便用户寻找和选择网站和应用程序图标的资源集合,可以为网站和应用程序带来更好的用户体验和品牌形象。 ### 回答2: Favicon图标大全是指所有网站中使用的用于标识网站的小图标的集合。它通常显示在浏览器标签页和书签栏上,以方便用户在多个网页中快速识别网站。Favicon是“Favorites Icon”的缩写,意味着它是一种用于标记用户的收藏夹的图标。 Favicon图标大全包括各种不同类型和尺寸的图标,以适应不同设备和平台的需求。一般来说,最常见的尺寸是16x16像素和32x32像素。除了这些常见的尺寸,还有一些其他尺寸,如48x48像素和64x64像素,以及适用于高分辨率显示器的更大尺寸Favicon图标可以根据网站的品牌和标识来设计,通常包括网站的logo或简化的标志。它可以是简单的图形符号、字母、数字或组合,也可以是更复杂的图像。它的设计应该与网站的整体风格和设计一致,以提升用户对网站的认知和记忆。 为了在网站中使用Favicon图标,开发者需要在网站的HTML代码中添加一行代码来引用图标文件,并将图标文件放置在网站的根目录下。常见的图标文件格式包括ICO、PNG和SVG。 Favicon图标大全可以帮助网站开发者快速找到适合其网站的图标,并提供了各种不同样式和设计的选择。当用户浏览网页时,这些图标可以帮助他们更容易地识别和区分不同的网站,提高用户体验和品牌知名度。 ### 回答3: favicon图标大全是指收集和整理了各种网站所使用的favicon图标的资源库。favicon是网站标签栏、书签栏、浏览器标签页以及网站链接的显示图标,具有辨识度和品牌形象的作用。 在日常浏览网页时我们常常看到网站的标签页上有一个小小的图标,这就是favicon图标。favicon图标不仅可以增加网站的专业性和美观性,也可以提高用户对网站的识别度和留存率。 favicon图标大全资源库汇集了各种各样的图标,包括来自不同行业、不同风格的网站所使用的图标。在使用这个资源库时,我们可以根据需要选择合适的图标,然后将其嵌入到网站的代码中。这样,当用户在浏览器中访问我们的网站时,就会看到我们自定义的favicon图标了。 通过使用favicon图标大全资源库,我们能够避免从零开始设计和制作一个新的favicon图标,节省了时间和人力成本。另外,这些资源库通常会定期更新,可以及时收集到新的图标素材,保持网站的时尚和与时俱进。 总之,favicon图标大全是一个帮助网站设计者和开发者找到合适的个性化图标的资源库。通过选择和使用这些图标,我们可以提升网站的形象与用户体验,使得网站更加专业和独特。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值