rohit mishra
rohit mishra

Reputation: 37

Favicon does not shows up in google chrome

I have a website which i tested on 3 browsers IE,Firefox and Chrome, my favicon doesn't seems to show up in chrome but it does shows in other browsers. I have tried clearing cache of chrome multiple times but doesn't seems to be helping though.

Can you please suggest me some way to fix this .

Upvotes: 1

Views: 374

Answers (2)

philippe_b
philippe_b

Reputation: 41408

Make sure you don't have any body-related markup (eg. a div) in your head, before the favicon declarations. For example:

<html>
  <head>
    <title>My page</title>
    <div>stuff</div> <?-- This div has nothing to do here -->
    <link rel="icon" href="/favicon.ico">
  </head>
  <body>...</body>
</html>

The reason is: as soon as Chrome encounters a markup it is not supposed to find in the header (div, p...), it considers the header to be over. Therefore, all following markups, which do not make any sense in the body, are ignored. This is the case of the link markup you probably use for the favicon.

This behavior is specific to Chrome. That would explain why you get this bug only with this browser.

Upvotes: 1

akash
akash

Reputation: 2157

Open your icon url in new tab and press ctrl + F5

To get icon url go to view-source by ctrl + U and you well get href click on that url.

<link rel="shortcut icon" href="//cdn.sstatic.net/stackoverflow/img/favicon.ico?v=6cd6089ee7f6">

Upvotes: 0

Related Questions