Mark Golubev Mark Golubev -4 years ago 123
CSS Question

Linking my favicon.ico file, but something goes wrong

I uploaded my favicon.ico to /images/favicon.ico directory and I'm using this code to link it, but it doesn't show up on my website.
What am I doing wrong?

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

Answer Source

Technically speaking, favicon files should be in the root directory rather than a sub-directory, and if there's a favicon.ico file in the root directory technically you don't need to declare the path at all.

If you don't call the favicon, favicon.ico, you can use that tag to specify the actual path (incase you have it in an images/ directory). The browser/webpage looks for favicon.ico in the root directory by default.

If you really want to keep it in a sub-directory, do this:

link rel="icon" href="/images/favicon.ico" type="image/x-icon"

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download