Favicon not working in Internet Explorer

2019-07-07 04:06发布

I've done everything I could find to make favicon work, but only on IE it doesn't work.

This is in the <head>

<link rel="shortcut icon" href="//www.site.com/img/favicon.ico">

I tried to create a favicon with favicon.co.uk and favicon-generator.org/, but nothing works in IE.

It's 16x16 and a .ico file.

In google Chrome and Firefox it's working just fine.

When bookmarking in IE, it's also showing the icon. But not in the top bar.

What's wrong here ?

Edit:

I also tried this:

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

3条回答
男人必须洒脱
2楼-- · 2019-07-07 04:32

Fix the typo of the image. Also try adding type="image/x-icon" to the image tag.

<link rel="shortcut icon" href="http://www.site.com/img/favicon.ico" type="image/x-icon">

---- Edit ----

It seems rel="shortcut icon" is proprietary to IE. The most used standard is to put the favicon at the root of your website and call it favicon.ico

If you can bear to have the same favicon for all your pages, this will be recognize by all browsers wihtout the need to declare it in the HTML.

More detail there : http://mathiasbynens.be/notes/rel-shortcut-icon

查看更多
别忘想泡老子
3楼-- · 2019-07-07 04:40

For who is interested:

It works now, I tried a different website to create the favicon and it worked.

<link rel="shortcut icon" href="http://www.url.com/img/favicon.ico" type="image/x-icon">
查看更多
男人必须洒脱
4楼-- · 2019-07-07 04:55

Faced with same problem. Solved my case easily.

It seems IE doesn't accept favicons from subfolders. Try placing favicon.ico in root directory.

  1. Place favicon file in root (/favicon.ico).

  2. Rewrite head tags:

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

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

Hope this helped

查看更多
登录 后发表回答