View Full Version : Code for favicon.ico

Mr. Pink
08-20-2009, 11:03 AM
I went to a few sites to generate a favicon.ico file, for my site and I noticed that the instructions for the code are not the same, depending who gives the instructions.

these are the different versions of the code:

<LINK rel="shortcut icon" href="/favicon.ico">
<LINK rel="shortcut icon" href="favicon.ico">
<LINK rel="shortcut icon" href="favicon.ico" />
<LINK rel="shortcut icon" href="favicon.ico" >

I'm assuming all version of the code are OK, but are there any browser compatibility issues, depending which version is used?

Is one version better then the others?


PS - And finally, I've used a favicon.ico file on my other sites, in the past, without any code added to the HTML pages. So, is that code even needed?

08-21-2009, 09:09 AM
Some browsers will look for it by default, so no, the code isn't always needed.

Technically all of your examples fail.

LINK should not be capitalized, in any, that is against standards (though, it will not matter).

For usability and avoidance of possible errors for you when building your site, the path should be absolute.

Finally, for standards, there should be a closing slash.

So I would use this:

<link rel="shortcut icon" href="/favicon.ico" />

09-07-2009, 07:12 PM
firstly.do you ensure your programe support this function ,i think your guess maybe right,the version is more important ,but on another hand,you have to pay attention to the path or directory,the correct directory ,please preview it from http://www.yourdomainname.com/favicon.ico if you can see it ,everything is ok...