Favicon not showing, my icon is no good

落花浮王杯 提交于 2019-12-19 10:03:45

问题


I am able to use favicons if I copy one from another site and test. But my own doesn't work in IE8/Chrome. Mine is a 32x32 24bit icon created by Visual Studio. I always seem to have problems getting icons working right, what should I use? I thought I could have images up to 64x64...


回答1:


See this site for instructions for creating a favicon.ico - it needs to be 16*16, not 32*32 (though you can have a composite .ico with both sizes).

I have created composite .ico files with several sizes, so they appear correctly on the browser and the desktop.




回答2:


First, just to be safe, convert your original icon to an .ico using this converter.

Then, for cross-browser compatibility (specifically Internet Explorer), use:

<link rel="shortcut icon" href="http://www.yoursite.com/youricon.ico" />

Most browsers are smart enough to use any PNG/ICO named favicon.ico located in the root of your site, but this is not always reliable.




回答3:


The wikipedia page on favicon contains a lot of information.

The support for favicons differ a bit from browser to browser, and there is no guarantee that the favicon will work on any given system. Sometimes the browser just ignores it for no apparent reason.

To get the widest browser support, you should use the .ico format. There is a compatibility chart on the wikipedia page that tells you how widely supported each format is.




回答4:


You need to use 16x16 .ico file. 32x32 .ico files and .png, .jpg files don't always work in browser title bars. Nowadays you might find some browsers support this but not every browser does this so try to stick to 16x16 .ico files.



来源:https://stackoverflow.com/questions/2912708/favicon-not-showing-my-icon-is-no-good

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!