0

Here is my code:

<link 
rel = "shortcut icon" 
type = "image/x-icon" 
href = "C:/Users/SOMEBODY/Desktop/SOME FOLDER/ANOTHER FOLDER/favicon.ico"/>

I also have the favicon in the same folder as my website. When I open the .HTML file, it doesn't show me the icon. Btw, my website is unpublished to the web.

Somebody
  • 49
  • 8
  • Does this answer your question? [Adding a favicon to a static HTML page](https://stackoverflow.com/questions/9943771/adding-a-favicon-to-a-static-html-page) – buddemat Nov 27 '20 at 18:54

2 Answers2

0

If you have the favicon in the same folder as you HTML file you can use a relative path like bellow

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

I presume the issue is related to the path C:/Users/SOMEBODY/Desktop/SOME FOLDER/ANOTHER FOLDER/favicon.ico you should escape all space of the path for it to be correctly interpreted.

You should also reference the absolute file using file protocol like this

<link rel="shortcut icon" href="file://C:/Users/SOMEBODY/Desktop/SOME FOLDER/ANOTHER FOLDER/favicon.ico"/>
Yves Kipondo
  • 5,289
  • 1
  • 18
  • 31
0

I also faced the same problem and what I did was:

  • Open the .ico file on your browser by selecting the address or by dragging.
  • And select the image url, paste it in your html file.
    This time it should work. Although, they both should look same, but they are not.
    And remember that sometimes Mozilla Firefox do not load favicon if it is stored locally.
m24197
  • 1,038
  • 1
  • 4
  • 12