Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shortcut icon is not working

Tags:

html

favicon

I'm creating an HTML web page. I'm nowhere near finish and therefore should not focus too much on the following matter at the moment. But I'm confused about why my code for the Shortcut icon is not working. I'm testing everything by placing all files in the same folder (offline, no servers or anything similar)

The code is

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

I tried with different ico files and it will only work with an ico uploaded to a website. For example the following code will work.

<link rel="SHORTCUT ICON" type="image/x-icon" href="\WEBSITEFOLDER\favicon.ico">
like image 746
Vairon Avatar asked Aug 24 '12 21:08

Vairon


People also ask

How do I fix shortcut icons not working?

Restart Windows Explorer Windows Explorer (explorer.exe) controls the desktop view (icons, taskbar and system tray). Restarting this service can refresh the desktop. On your keyboard, you'll want to hit Ctrl + Alt + Del and then select Task Manager. Find the service, right-click and choose to Restart.

Why are my shortcuts not working?

Keyboard shortcuts could fail to work if you don't press the key combinations at the same time. If you are having difficulties pressing multiple keys at the same time, you should enable Sticky Keys. This Windows 10 feature allows you to press the shortcut keys one after another.

Why are my shortcuts not showing icons?

Right-click on an empty space on your desktop. Click on the “View” option from the context menu to expand the options. Make sure that “Show desktop icons” is ticked. If it isn't, simply click on it once to ensure it wasn't causing issues with displaying your desktop icons.

Why are my shortcut icons not working Windows 10?

If your icons are corrupted or not displaying properly, you can reset the Windows 10 icon cache to fix them. The easiest way to do it is by using the free Winaero Tweaker utility. This free utility provides an assortment of options for fixing common problems users will experience in Windows 10 from time to time.


2 Answers

Try:

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

or:

<link rel="Shortcut Icon" type="image/ico" href="favicon.ico">
like image 109
coceban.vlad Avatar answered Sep 22 '22 02:09

coceban.vlad


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

like image 25
user1670316 Avatar answered Sep 20 '22 02:09

user1670316