Setting up Favicons in IE7, Firefox, Safari, and Opera
Firefox(+Camino), Safari, and Opera:
These browsers are easy to setup and only require a 16×16 image file (png, jpg, or gif) and a link tag in the head tag of your code.
<link rel="icon" type="image/png" href="/favicon.png" />
IE7:
IE 7 is a little more tricky. First, IE requires an actual icon file. Not just a jpg or png renamed with an ico extension. But no worries there are a few sites online that will convert your images into ico format for you.
IE automaticaly checks the root directory for a file called favicon.ico, so thats where I recommend placing your image. (/favicon.ico)
You don’t need any link code snippet to make this work, but if you wanted to force IE to find it and or change it for another page you can use the following link code in the head tag.
<link href="/favicon.ico" type="image/x-icon" rel="shortcut icon" />
I wrap this code with an IE conditional comment. Although the other browsers recognize this code, it’s not correct if your trying to produce accurate XHTML, because of the space in “shortcut icon”.
<!--[if IE]> <link href="/favicon.ico" type="image/x-icon" rel="shortcut icon" /> <![endif]-->
Troubleshooting IE:
If your favicon doesn’t show up immediatly it’s because you need to clear your temporary files as well as your browser history. That should force IE to update the favicon.
Also make sure that your not preventing IE from cacheing your favicon. You’ll need to check your headers, using a tool like fiddler. But most likely you won’t need to worry about this.
If you have any questions don’t hesitate to drop me an email.
This entry was posted on Tuesday, February 17th, 2009 at 5:23 pm and is filed under Web Design. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.












I like this post Greg. Favicons can be a pain.
Hey Greg,
Thanks for this helpful info. I am running into a goofy issue with FireFox though. My site requires the “www.” prefix, where other browsers do not. Any ideas?
Thanks,
Justin
I didn’t have any problem with your site with or without the ‘www’, using OSX with Firefox 3.05.
Did you just change your DNS settings? It can take awhile for changes to propagate.
It would appear that you are correct sir! =)
I guess it was taking longer to propagate than I thought it would.
I’m not sure why it was only an issue with Firefox for me, maybe something cached or unique to my local browser instance. Thanks for the help though!