Why does my website's favicon show up as a red line? - html

My website favicon shows up in Chrome and Edge with a red line. This happens on Firefox and Safari on the Mac as well.
As far as I know, the only code I need to set the favicon is the following:
<link rel="shortcut icon" href="/static/sitefavicon.ico" type="image/x-icon">
<link rel="icon" href="/static/sitefavicon.ico" type="image/x-icon">
This is present in the HTML and the links work when I inspect the page, but the favicon shows up as a red line as in the above screenshot.
I have tried using direct links (i.e., with https:// instead of relative links like those above) with no effect. I have also tried clearing my caches and using a different machine and this too seems to have no effect. If it matters, the website is powered by Django and hosted on AWS.

Re-encoding the image as png and changing type to image/png fixed the issue.

Try removing that leading slash:
href="static/sitefavicon.ico"

Related

How to create a favicon for Safari 14?

I am trying to create favicon for my website (it is not live yet.) Favicon shows on Chrome but not on Safari 14. I have the setting to see websites' favicon turned on. I also tried cleaning Safari's favicon cache. I am using an PNG photo. What shows on Safari is more like a dull/flat representation. Safari Chrome
I tried these websites:
https://favicon.io
https://www.favicon-generator.org
https://realfavicongenerator.net
They all work on Chrome but not on Safari.
I solved it. So, instead of deleting files in ~Library/Safari/Favicon Cache, I had to empty the entire Safari cache from Develop menu or using this keyboard shortcut ⌥⌘E
You would need to have two links,
<link rel="shortcut icon" type="image/png" href="yourfavicon.png"/> (for chrome)
<link rel="apple-touch-icon" href="yourfavicon.png"> (safari)
Just place both tags in the <head> section of your HTML. Here's the link if you want to read more: https://css-tricks.com/favicon-quiz/

Get chrome/brave browser to use png version of favicon

Unsolved
I want the proper png to show up in the browser tab while still maintain the app I use to connect my website with uses the gif favicon
So I'm using metamask as an extension and it automatically looks for the first favicon so thus my first favicon is a gif for an animation. But while firefox automatically uses the png version of my favicon, how do I get a browser like Chrome to use the png version as well in the browser tab menu?
So the HTML goes like this...
<link rel="icon" href="%PUBLIC_URL%/animation.gif" type="image/gif" >
<link rel="shortcut icon" type="image/png" href="%PUBLIC_URL%/favicon144.png" />
The first is the gif which I need to be first due to metamask and the second is the png version which chrome skips over.
I am currently using Chrome version 79.0.3945.117. Using this code in HTML, it correctly displays the PNG icon.
Code:
<link rel="icon" href="animation.gif" type="image/gif" >
<link rel="shortcut icon" href="favicon.png">
There doesn't seem to be any problems or interferences with my case.
For debugging, I recommend that you check for any 404 errors finding the image, or in other words, the wrong href route. Also, try clearing the cache of your browser and reload.
Glad to answer.

Favicon on IE 11: Why using a url is working and relative path not?

I'm trying to make my favicon works on IE11.
After reading many tutorials, I found the solution below, adding
<link rel="shortcut icon" href="./assets/favicon.ico" type="image/x-icon" />
Issue is the favicon is not appearing on IE11. Weird thing is the line below makes the favicon working on Firefox and Chrome as Firefox and Chrome can see properly where is the icon.
<link rel="icon" type="image/x-icon" href="./assets/favicon_bnp.png">
However, when I change the first line to the line below, hosting the favicon on a server, the favicon is appearing on IE11, Firefox and Chrome.
<link rel="shortcut icon" href="http://www.iconj.com/ico/f/q/fqp4dvw03t.ico" type="image/x-icon" />
What I would like is to have the href use a relative path.
Except the URL, I've tried to change favicons, change paths, to no avail.
Any hints are welcomed.
There're some solutions about this issue:
Make sure the image a real ico file and put it in the root folder of your web server. Renaming a bitmap is not a real ico. I use https://favicon.io/ to generator favicon and it can work in iE.
Make sure the <link> tag of the ico is between the <head> and use absolute path instead of relative path.
Delete your temporary Internet files and clear cache of IE. If the folder with temporary files has reached its maximum, the favicon may not be used.
For more information, you could refer to this thread and this thread and try the workarounds in them.

Not showing the favicon icon in chrome

I had inserted the tag:
<link rel="shortcut icon" href="Survey2016/favicon.ico"/>
This shows the icon in the Firefox browser, but it is not showing the in Chrome.
This is my tag:
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
Best practice is to just store the favicon in the root directory – or at least make it accessible there (through a URL rewrite f.e.).
You already did that, so you could remove the tag altogether. This is why you'd do that, you save a line of HTML.
With favorite icons, caching is a big problem. Sometimes opening the favicon directly (by typing /favicon.ico in the address bar) and then hard reloading (Shift+F5 or Shift+Click Reload) helps.
You might be having an old version of chrome which do not support favicon hosted on you local computer. Please host that image to an internet server and use it from that hosting website, that might help you.

Yet Another "Why isn't my Favicon showing?"

Update
I have just tried "Pinning" my site to the Taskbar again (after removing it) but when I clicked and held down the mouse button on the 16x16px icon inside the address bar (see pic below), you can see my favicon being dragged around with the mouse - so internet explorer has found and got the icon - it's just not displaying it in all the right places! Also updated code below:
As the title suggests, I can't get my favicon to display; in any version of any browser. There is 1 exception, though - which isn't good enough:
IE 9 and IE 10 -
As you can probably see in the screenshot above, the only time I get to see my favicon is after I've added it to my Favorites folder and opened the Favorites Bar. The favicon does not display in the Tab (next to the page title), it does not display in the Taskbar area, and it does not display up the top-left of the browser window if I have "Pinned" my site to the Taskbar.
In every other browser, it simply does not display at all.
I have tried every possible "solution" that I could find online.
Here's the code I have:
<link rel="icon" type="image/x-icon" href="http://www.mysite.com/favicon.ico"><!-- Major Browsers -->
<!--[if IE]><link rel="shortcut icon" href="http://www.mysite.com/favicon.ico"/><![endif]--><!-- Internet Explorer-->
I have also tried all common sizes for the favicon; 16x16, 32x32, 64x64, 128x128 and 256x256 - and I've even tried saving all sizes within the same *.ico file.
I have tried deleting the cache file for *.ico files.
Nothing has worked. The exact same code has previously worked on other sites that I've made. I don't get it. What gives?
I've edited this answer, leaving only solution to problem presented in question.
Use: <link rel="shortcut icon" href="{ICONURL}"/>
Instead of: <link rel="icon" href="{ICONURL}"/>
I had the same problem with my site just now. Drove myself crazy trying to get an favicon.ico file to work. What finally got it working correctly for me in IE 11 (on Windows 7), was to dump the favicon.ico file completely and go with a PNG instead:
<link rel="shortcut icon" href="/favicon-32x32.png" type="image/png"/>
I used a PNG file with a transparency layer. Once I did this and uploaded my page, IE began displaying the icon correctly in the Tabs (and the shortcuts/bookmarks) on the very next page refresh. I double checked and it looks like Chrome and Firefox are cool with this as well.
I use
<link rel="icon"
type="image/ico"
href="Link Goes Here">
If putting the favicon in a folder:
<link rel="icon"
type="image/ico"
herf="Folder/Subfolder"
Make sure the code is in the head tag.
Make sure the image is in the .ico format; It won't work otherwise.