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">
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.
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.
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.
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.
Try:
<link rel="SHORTCUT ICON" type="image/x-icon" href="~/favicon.ico">
or:
<link rel="Shortcut Icon" type="image/ico" href="favicon.ico">
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With