Shortcut icon not working

I am creating an HTML page. I am not close to completion anywhere and therefore should not pay too much attention to the next issue at the moment. But I'm confused by why my shortcut code is not working. I test everything by putting all the files in the same folder (offline, without servers or anything like that)

Code

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

I tried with various ico files and it will only work with ico uploaded to the site. For example, the following code will work.

 <link rel="SHORTCUT ICON" type="image/x-icon" href="\WEBSITEFOLDER\favicon.ico"> 
+4
source share
6 answers

Try:

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

or

 <link rel="Shortcut Icon" type="image/ico" href="favicon.ico"> 
+3
source

I ran into this similar problem and it turned out that the actual file size was the cause of this problem. According to sources, it should be either 16x16 or 32x32. I would use an icon generator, for example: x-iconeditor.com .

+2
source

If you need an icon in a local file, you will have to use a data URI

See this answer: local (file: //) favicon website works in Firefox and not in Chrome or Safari - why?

+1
source

set favicon icon icon 16x16, it will work in chrome ...

0
source

I had the same problem. The site I borrowed used the Icons folder for the location of the .ico file, so I definitely did. My girlfriend's service was used by Web.com. For any reason with a website, if the shortcut icon is located in any place other than the root directory, it will not appear in Internet Explorer. I just moved the favicon file to the same place index.html was and changed that one line of code in the index reflects this.

Solved (anyway)! Good luck

0
source
 <link rel="icon" href="relative_PATH/favicon.ico"> 

Try putting all relative paths in the icon file

0
source

All Articles