jlh
jlh

Reputation: 31

Favicon doesn't display in IE and Chrome

I'm really puzzled about why my favicon doesn't show up in either IE9 or Chrome. It does show in Firefox though. I've used favicons before and never had such troubles, and my code is quite trivial:

<!DOCTYPE HTML>
<html>
<head>
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
</head>
<body>

</body>
</html>

The file favicon.ico I use is directly taken from Wikipedia (for testing purpose to be sure it's not a faulty ICO file) and put in the same folder as the HTML file. I tried clearing the browser's caches and restarting them, but nothing works. Also, this is not on a web server, I open the HTMLs directly from the file system.

Upvotes: 3

Views: 11354

Answers (5)

Luc Laverdure
Luc Laverdure

Reputation: 1480

Make sure it's an actual icon file and not a bmp/jpg/png saved as .ico,

use this if it helps:

http://www.favicon.cc/

Upvotes: 0

Dennis
Dennis

Reputation: 1

Try this (with slash):

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

This should work

Upvotes: 0

KingKongFrog
KingKongFrog

Reputation: 14419

Clear your history.

Hit the file directly first in your browser address bar.

Then remove your whole line since by default it looks at the root for that file.

Upvotes: 0

Xavi L&#243;pez
Xavi L&#243;pez

Reputation: 27880

I get favicons to work in Chrome with

<html>
<head>
<link rel="shortcut icon" href="/myapp/img/favicon.ico" />
</head>
</body>

Maybe strip the TYPE attribute?

Upvotes: 0

Musaab
Musaab

Reputation: 1604

Also add another tag to make it like this for increased browser coverage:

<LINK REL="icon" HREF="favicon.ico" TYPE="image/x-icon">
<LINK REL="shortcut icon" HREF="favicon.ico" TYPE="image/x-icon"> 

Upvotes: 1

Related Questions