Mobile app version of vmapp.org
Login or Join
Kaufman445

: Any reason a site has 2 links to favicon? A site I'm looking at has the following 2 links to its favicon: <link rel="shortcut icon" type="image/ico" href="/_assets960/media/favicon.ico" />

@Kaufman445

Posted in: #Favicon

A site I'm looking at has the following 2 links to its favicon:

<link rel="shortcut icon" type="image/ico" href="/_assets960/media/favicon.ico" />

<link rel="icon" href="/favIcon.ico"/>


Question: Is there a good reason why you would specify the icon twice in these two slightly-different ways?

10.04% popularity Vote Up Vote Down


Login to follow query

More posts by @Kaufman445

3 Comments

Sorted by latest first Latest Oldest Best

 

@Dunderdale272

The line below works in all browsers:

<link rel="shortcut icon" href="http://www.your-site-domain/favicon.ico">


And it it's the only line used also by StackExchange sites (see in this page source code)

<link rel="shortcut icon" href="http://cdn.sstatic.net/webmasters/img/favicon.ico">


NOTE: the full http path of the favicon is necessary to show icon in IE, in all other browsers you don't need the full http path.

10% popularity Vote Up Vote Down


 

@Mendez628

Really both lines are unneeded. You just need to put a favicon.ico file in your root directory and you should be fine. You can include code like the above to allow for the favicon to load before the page finishes loading but that is unimportant. It looks like the code in question above was created out of confusion.

10% popularity Vote Up Vote Down


 

@Merenda212

The reason is compatibility with Internet Explorer. rel="icon" is the way it is done in HTML5 or any other browser than IE.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme