Forum Moderators: open
<link type="image/png" href="/images/site/favicon.png" rel="icon">
.
For IE I just dump the .ico file into the root folder, with no reference from the HTML pages themselves.
.
[For Clarification]
[edited by: g1smd at 9:33 pm (utc) on July 17, 2008]
I suspect your incorrect MIME-type may have somethi9ng to do with it... Try image/png, since the file is not
really of type image/x-icon.
Jim
smithaa02:
I know IE7 supports png icons now. Any ideas?
Are you sure? IE7 includes enhanced support for PNG images that appear in the page, but unfortunately I don't think this extends as far as favicons...?
From jeff's MSDN weblog... why doesn't the favicon for my site appear in IE7? [blogs.msdn.com]
A: It must actually be a .ico (an Icon) file. Bitmaps, pngs, gifs, etc, will not work. IE7 will download your favicon to the Temporary Internet Files folder and call ExtractIcon() on the file. If this fails, we will show the default icon instead of your favicon.
If you are using alpha transparency in your PNG then you're likely to have to redo your icon for IE (the ico format supports justs a single transparent colour), or choose a suitable background colour before 'flattening' your image? But otherwise, the .ico format supports 256 colours which is fine for a 16x16 favicon.
Check out this other recent thread on favicons...
[webmasterworld.com...]
Be sure to test what your .png icon looks like if you drag it from the browser address bar to the desktop, and test with both "normal" and "large" size desktop icon settings. I believe you'll see the reason I suggest using the multi-resolution .ico format (if dragging to the desktop works at all with a 16x16 .png). The only reason I feel strongly about this is that when a visitor makes a desktop shortcut to your site, and it's small or does not work properly, then this becomes a usability problem, instead of a matter of "personal preference." The .png format is great, but it's just not good for icons because there's no multi-res support.
Jim
Is there an easy way to make sure Firefox gets the superior PNG icons and IE gets the ICO file?
See g1smd's post above. Also, that other thread [webmasterworld.com] I mentioned for a lot more info.