0

Something werid happens to me, I am going to build my personal website, put favicon.ico in the header.html, like below:

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

And clean up the history records of the browser, Firefox shows the icon, but Chrome doesn't show up.

I can't figure out the reason, please help me.

Tangoo
  • 1,329
  • 4
  • 14
  • 34
  • Possible duplicate of [Chrome doesn't show the favicon](http://stackoverflow.com/questions/16869112/chrome-doesnt-show-the-favicon) – ilyankou Dec 04 '15 at 02:55

1 Answers1

0

This is probably because you have non-header markups in your head. For example:

<html>
  <head>
    <div>This div has nothing to do here. It's a "body" markup.</div>
    <link rel="shortcut icon" href="/favicon.ico">
  </head>
  <body>
     ...
  </body>
</html>

When Chrome finds a non-header markups in the head (eg. div, span, p...), it considers the header to be completed (even if it is not technically closed) and everything that follows is supposed to be in the body. And since the favicon markup doesn't work when it is in the body...

This behavior is specific to Chrome, this is why your favicon work in Firefox.

philippe_b
  • 38,730
  • 7
  • 57
  • 59