sakthidas
sakthidas

Reputation: 69

Favicon not displaying

I am developing a site in PHP. The favicon is not displaying in Chrome and IE9.

I tried is:

'<link rel="icon" href="../images/Favicon.ico" />'

which works in Firefox.

Upvotes: 3

Views: 5842

Answers (3)

Rui Nunes
Rui Nunes

Reputation: 858

For any favico(n), make sure in the source that it opens on a new tab / that the paths are right. Firefox usually "just displays it". If you don't see it for Chrome - when developing locally - right-click the refresh button and from the context menu, select "Empty cache and hard-reload".

Upvotes: 0

learner
learner

Reputation: 5

I had this similar issue and found that following the W3C recommendation : https://www.w3.org/2005/10/howto-favicon is the best way to do this.

<link rel="icon" type="image/png" href="favicon.png">

P.S For some reason, the combination of type="image/x-icon" and href="favicon.ico" did not work for me, which is why I changed my icon to a .png file.

This works perfectly on IE11/ Firefox and Chrome.

Upvotes: 0

FeRtoll
FeRtoll

Reputation: 1267

There are much things that can make it not to work.

  • First of all check the path if its ok. Because your path leads to some directory outside the current one (../).
  • Icon file must be an icon not just image renamed to .ico
  • use ctrl+f5 to refresh your browser or clean all cache and close browser and try again or even try it in some other pc
  • favicon.ico should be always (the best is) in root directory

And to be sure you could use this both:

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

Hope it helps.

Upvotes: 7

Related Questions