: 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" />
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?
More posts by @Kaufman445
3 Comments
Sorted by latest first Latest Oldest Best
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.
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.
The reason is compatibility with Internet Explorer. rel="icon" is the way it is done in HTML5 or any other browser than IE.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.