Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11
  1. #1
    Regular Coder
    Join Date
    Jan 2004
    Location
    USA
    Posts
    364
    Thanks
    12
    Thanked 6 Times in 6 Posts

    quick favicon question

    hello,
    one quick favicon question.
    Which should be used, or which is the proper/correct one to use:
    image/x-icon, image/icon, image/ico
    or another one? I've seen a few more than the 3 I listed.

    Also, is it rel="icon" or rel="shortcut icon"?

    <link rel="icon or shortcut icon" type="image/x-icon, image/icon, image/ico" href="favicon.ico" />
    Running Windows 7 x64

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Canada
    Posts
    253
    Thanks
    0
    Thanked 0 Times in 0 Posts
    this is what i got (dunno for correctness or not)...

    <link rel="SHORTCUT ICON" href="http://www.mydomain.com/favicon.ico" />

  • #3
    Senior Coder
    Join Date
    Jul 2004
    Location
    New Zealand
    Posts
    1,315
    Thanks
    0
    Thanked 2 Times in 2 Posts
    It should be
    Code:
    <link rel="icon" type="image/png" href="/images/icon.png">
    because PNG is cross-platform. But if you care about IE, you'll need to use... Well, I was going to show what to use for IE, but I can't get it to use the icon no matter what I do. Fudge IE, use my code above.

  • #4
    Regular Coder
    Join Date
    Apr 2004
    Location
    Birmingham, MI
    Posts
    131
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You know, Internet Explorer is so funky with favicons, it seems like the icon only displays after you have bookmarked the page, then it works just fine.

    http://msdn.microsoft.com/workshop/A...ortcutIcon.asp

  • #5
    Master Coder
    Join Date
    Feb 2003
    Location
    UmeŚ, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    rel should be "shortcut icon" (case insensitive)

    type should be "image/x-icon" for the windows icon type, or a bitmap type for some other icon formats.

    (PNG is an option, but the ICO format is actually more cross platform at the moment.)
    Last edited by liorean; 10-19-2004 at 03:17 AM.
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • #6
    Regular Coder ArcticFox's Avatar
    Join Date
    Jan 2004
    Location
    Vostok Station, AQ
    Posts
    602
    Thanks
    35
    Thanked 3 Times in 3 Posts

    Internet Explorer

    Quote Originally Posted by hemebond
    It should be
    Code:
    <link rel="icon" type="image/png" href="/images/icon.png">
    because PNG is cross-platform. But if you care about IE, you'll need to use... Well, I was going to show what to use for IE, but I can't get it to use the icon no matter what I do. Fudge IE, use my code above.

    LOL!

    You cannot have an favicon using a .png image, it needs to be a .ico

    No wonder you canít get it to show up in IE.
    <div> - putting your mind in a box since 1997

  • #7
    Master Coder
    Join Date
    Feb 2003
    Location
    UmeŚ, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    Quote Originally Posted by ArcticFox
    LOL!

    You cannot have an favicon using a .png image, it needs to be a .ico

    No wonder you canít get it to show up in IE.
    Well, iew doesn't support favicons in PNG format. Big deal, it doesn't use the favicon unless you bookmark the site anyway. More irritating is that it doesn't support PNG for site icons (which require you to use the link element with the attributes I outlined in my last post), unlike the rest of the browsers.
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • #8
    Regular Coder ArcticFox's Avatar
    Join Date
    Jan 2004
    Location
    Vostok Station, AQ
    Posts
    602
    Thanks
    35
    Thanked 3 Times in 3 Posts

    Question

    So, other browsers accept .png as a favicon?

    Well I'll be snickered...

    I've given up in trying to show favicons in IE a long time ago. But it's cool to know that I don't need a .ico for the others.
    <div> - putting your mind in a box since 1997

  • #9
    Senior Coder
    Join Date
    Jul 2004
    Location
    New Zealand
    Posts
    1,315
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by ArcticFox
    You cannot have an favicon using a .png image, it needs to be a .ico

    No wonder you canít get it to show up in IE.
    I tested with an .ico file.

  • #10
    Regular Coder
    Join Date
    Jan 2004
    Location
    USA
    Posts
    364
    Thanks
    12
    Thanked 6 Times in 6 Posts
    so....the best way to define a favicon is:

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

    correct?
    Running Windows 7 x64

  • #11
    Master Coder
    Join Date
    Feb 2003
    Location
    UmeŚ, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    Yes, correct


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •