开发者

If I have a favicon, do I need to link to it?

I have a Favicon and in my page I have something like:

<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />

This works fine. But inspired by the book "Ultra Fast asp" I am trying to remove all the small bits that are not necessary. I read a lot about browsers 开发者_运维知识库looking for favicon.ico anyway. (People complaining about 404 errors if they do not have a favicon).

So I was wondering: what is the use of the link if the browser looks for it anyway. It is "dead wood" -> so can I just remove this link completely or am I missing something.

thanks for your ideas, Pleun


Using the explicit link syntax allows you to use different icons on different pages, and to have icon support on the browsers that do not automatically download the favicon.ico that is in the root of the site.

If you only ever use one icon on a website and don't care about browsers that do not automatically download the root icon, the links are not needed.


As long as your favicon is in the root of your website (ie. /favicon.ico), then yes you can drop this link. The link allows you to change where you want to store your favicon.


The standard specified by W3C uses the link tag rather than automagically look for the file in the root, but all major browsers will support both ways.

The Wikipedia article about favicon is a good overview of the possibilities and the browser support.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜