Forums

[resolved] Fav Icon? (8 posts)

  1. x0PRAH_WINFR3Yx
    Member
    Posted 1 year ago #

    Where abouts do I place my favicon? I'd really love to get rid of my browsers default.

    Thanks.

  2. richarduk
    Member
    Posted 1 year ago #

    Favicon from http://tools.dynamicdrive.com/favicon/ 16 x 16 plus transparency - use this for transparencies. Unzip and post in root e.g mysite.com/favicon

    Put this in <head> </head> section of all pages

    <link rel="icon" href="http://www.mysite/favicon.ico" type="image/x-icon" />
    <link rel="shortcut icon" href="http://www.mysite/favicon.ico" type="image/x-icon" />
  3. Otto42
    Moderator
    Posted 1 year ago #

    Actually, you only need this line:
    <link rel="shortcut icon" href="http://example.com/favicon.ico" type="image/x-icon" />

    The "icon" only line is unnecessary, the "shortcut icon" line works in all current browsers.

    And ideally, it would be better to use the "image/vnd.microsoft.icon" for the type field, the old "x-icon" is only for compatibility purposes and older browsers.

  4. x0PRAH_WINFR3Yx
    Member
    Posted 1 year ago #

    Thanks so much guys!

  5. richarduk
    Member
    Posted 1 year ago #

    Live and learn.

    From Otto42 above, http://3spots.blogspot.com/2006/04/favicons-codes-tools-resource.html and from Wikipedia http://en.wikipedia.org/wiki/Favicon I get this

    <link rel="shortcut icon" href="http://example.com/favicon.ico" type="image/vnd.microsoft.icon" />
    <link rel="icon" href="http://example.com/images/favicon.gif" type="image/gif" />

    Does that look reasonable?

    As I understand it the first line will be a standard favicon for older browsers, whilst the second line will offer an alternative gif not necessarily in the root

  6. Otto42
    Moderator
    Posted 1 year ago #

    Well, that's actually a bit confusing. Here's the breakdown:

    The standard says that this should work:
    <link rel="icon" href="http://example.com/images/favicon.ext" type="image/whatever" />

    You can use any sort of image as long as you use the right MIME type.

    However, certain older browsers (IE) can't deal with anything but ICO files. And certain older browsers (again, IE) expect "shortcut icon". And then certain older browsers (do you see where I'm going with this?) can't deal with "image/vnd.microsoft.icon" types. And then again, certain older browsers (sigh) can't handle anything but "favicon.ico" in the root directory of the site.

    For full compatibility, this always works:
    <link rel="shortcut icon" href="http://example.com/favicon.ico" type="image/x-icon" />

    If you don't care about anything older than current browsers, using just "icon" and any image file type in any location will work fine.

    Note that specifying two different icons is not recommended in any case, because then it's confusing.

  7. richarduk
    Member
    Posted 1 year ago #

    Thank you!

  8. ovomac
    Member
    Posted 6 months ago #

    Can't be done. This is way too confusing.

Topic Closed

This topic has been closed to new replies.

About this Topic