Help - Search - Members - Calendar
Full Version: Adding a Favicon
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
klarko4444
I am trying to add a favicon to a site i am working on: http://annum.ca/
I have made a favicon.ico file and placed in in my root folder.
I have added the following to the header of my index.html:
<link rel="icon" type="image/ico" href="root/favicon.ico"></link>
<link rel="shortcut icon" href="root/favicon.ico"></link>

When I view it in Safari or Firefox, the icon does not show up.

Any suggestions?

Thank you so much.

Claire.
pandy
QUOTE(klarko4444 @ Feb 14 2011, 12:58 AM) *

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


Well, there is no directory called "root" http://annum.ca/root/ . The expression "document root" refers to the topmost directory that's accessible from the web, that is http://annum.ca/ and it seems there is where you have placed the icon. But you have a more serious problem. The server you are on doesn't seem to be configured to hande the ico format.
http://annum.ca/favicon.ico
Provided that file is the icon. It says something about PDF. blink.gif

Frederiek
My Safari returns: "Resource interpreted as image but transferred with MIME type text/plain."

In fact, you don't really need to put a LINK for a favicon. Most browsers (as of IE5) automatically look for a favicon.ico at the root of the site.

Anyway, the code looks like this:

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

See also the FAQ at http://htmlhelp.com/faq/html/effects.html#favicon or search for "favicon code" on the web.
klarko4444
Thanks guys! I will keep trying....
pandy
You must fix the content-type for .ico before it can work. Or ask your host to do it for the whole server if you can't do it yourself.
Frederiek
The favicon still doesn't show up, returning the same message. Just use one of the LINK lines for the favicon or you might as well get rid of them entirely.

BTW, LINK is an empty element, meaning it doesn't have a </link> closing tag, which you added. In XHTML, you need to close it like you did with other empty elements on the page.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.