0

I know this question is already asked many times, but for some reason I can't add my website's icon image inside the browser title bar, I've already tried this:

`<link rel="shortcut icon" type ="image/x-icon" href="location/image.ico">`

I put that code inside HTML <head>, below the <title> tag, but it still does not work. Did I make a silly mistake, or what? The image I used has the size of 16x16 pixel, and in .ico format.

zer00ne
  • 41,936
  • 6
  • 41
  • 68
Trickster01
  • 13
  • 1
  • 4
  • That is the right way to load an icon. Try flushing you'r cache. In chrome it would be : F12, click and hold on the refresh and choose empty cache. – wmehanna Jan 09 '16 at 02:46
  • The favicon normally stays in the root directory `/favicon.ico` In fact you don't need to add that link at all - https://en.wikipedia.org/wiki/Favicon – Stickers Jan 09 '16 at 04:14

4 Answers4

0

If you use the html as provided in the question, it should work. Try to flush your cache.

Also visit this page to get cross-plattform support and optimized images. RealFaviconGenerator

On the page is also explained why you should not use an actual *.ico file.

When your favicon is in the root directory, RealFaviconGenerator does not generate this code. This is because it somehow disrupts some other browsers like Chrome. And since IE looks for a file named favicon.ico anyway, the best solution is to not even talk about it.

Resource

Marten Zander
  • 2,385
  • 3
  • 17
  • 32
0

Read this article and you may know how to deal itrel="shortcut icon" considered harmful,

If you want your favicon to load you can simply use this code:

<link rel="icon" href="/favicon.ico">
yangzj1992
  • 11
  • 1
0

Originally you had to name your site icon file , favicon.ico and you were required to upload it to the root of your site.

Example - Site: http://www.domain.com Root: http://www.domain.com/ Icon: http://www.domain.com/favicon.ico

Now the requirements are less strict and what you have is correct (as long as you remembered to upload the icon to your site)

Current - <link rel="shortcut icon" href="location/image.ico" type="image/x-icon" />

Try the older way and see if you get anything.

zer00ne
  • 41,936
  • 6
  • 41
  • 68
0

Your code is correct. Try to use the reload button. It will flush the catch and load the page again, chances are there it should display the new favicon!

Sibidharan
  • 2,717
  • 2
  • 26
  • 54