gpt4 book ai didi

favicon - 是否从服务器获取了所有图标的大小?

转载 作者:行者123 更新时间:2023-12-04 03:54:01 24 4
gpt4 key购买 nike

如果我为favicon PNG指定不同的图像尺寸,例如:

<link rel="icon" type="image/png" sizes="16x16" href="/favicon.png" />
<link rel="icon" type="image/png" sizes="24x24" href="/favicon-24px.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32px.png" />
<link rel="icon" type="image/png" sizes="48x48" href="/favicon-48px.png" />
<link rel="icon" type="image/png" sizes="64x64" href="/favicon-64px.png" />
<link rel="icon" type="image/png" sizes="256x256" href="/favicon-256px.png" />
<link rel="icon" type="image/png" sizes="512x512" href="/favicon-512px.png" />
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />

这些文件中的每一个都会被获取吗?

最佳答案

引用http://www.jonathantneal.com/blog/understand-the-favicon/:

How do these PNG-favicon-compatible browsers determine which faviconshould be used? Firefox and Safari will use the favicon that comeslast. Chrome for Mac will use whichever favicon is ICO formatted,otherwise the 32×32 favicon. Chrome for Windows will use the faviconthat comes first if it is 16×16, otherwise the ICO. If none of theaforementioned options are available, both Chromes will use whicheverfavicon comes first, exactly the opposite of Firefox and Safari.Indeed, Chrome for Mac will ignore the 16×16 favicon and use the 32×32version if only to scale it back down to 16×16 on non-retina devices.Opera, not wanting to take sides, will choose from any of theavailable icons at complete random. I love that Opera does this.

And that’s just the beginning. Now it’s time to learn about theInternet Explorer caveats.

While IE8-10 will displaythe favicon on first load of the page, IE7 will skip the first loadand display the favicon during repeat visits. Worse yet, IE6 will onlydisplay the favicon once the site has been bookmarked and reopened inthe browser. IE6 will also drop the favicon whenever the browser cacheis cleared, and it will not display the favicon again until the siteis either re-bookmarked, or the favicon is somehow reloaded. If IE6and favicons mean a lot to you, you can force this reload with alittle JavaScript snippet, preferably wrapped in a conditionalcomment.

<!-- I "support" IE6 -->
<!--[if IE 6]><script>(new Image).src="path/to/favicon.ico"</script><![endif]-->

关于favicon - 是否从服务器获取了所有图标的大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8186879/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com