Looking at the source for Skype.com, I cannot find any <link rel="shortcut icon"> tag (or anything similar), and yet, the icon is clearly showing up in FireFox. Where are they defining the favicon?
http://www.skype.com/en/ (right click to view source)
Unless otherwise defined, the browser will look for the favicon in the root with the filename favicon.ico
www.skype.com/favicon.ico
As far as I know you need the exact name favicon.ico for the browser to detect it. That might be different in other browsers, but if you want to use .png instead of .ico for some reason it would be safer to call it out manually for browser compatibility even if the newer browsers are seeing it.
By default browsers will look in the root web directory for favicon.ico when a path is not explicitly specified by a <link> tag.
Related
My favicons are not showing up across browsers after I uploaded my website files onto the server. I have tried the following solutions on stackoverlow and nothing worked:
cleared cache on browsers
renamed the href <link href="img/favicon.ico" rel="shortcut icon"
type="image/x-icon" /> to something else, "favicon.ico",
"favicon.ico?"
Does anyone have any suggestions?
Thanks..
Perhaps try the following:
Place the file in the root - some browsers automatically look here for the favicon so may as well put it there if you can;
Drop "shortcut" - it is not a valid relation and isn't required from IE9 anyway (see: https://mathiasbynens.be/notes/rel-shortcut-icon). It may be complicating parsing. If needed to support IE8 and earlier, perhaps try a separate declaration.
Check that you have declared the "profile" in the head.
Consider adding variants for cross browser and purpose support (see: https://css-tricks.com/favicon-quiz/ - old, but shows issues).
Personally, can't wait till they all support svg.
I've looked at several posts on here, and I've done further research online, but I can't see to find the problem.
I put the favicon.ico in the main directory, but it's not showing up on any browser. I've tried it personally on Firefox and Safari, and I've tried the rest on Browsershots.
I also have this line in the head of the html:
<link rel="icon" type="image/x-icon" href="favicon.ico"/>
I've also tried it without the type..., as I have it on other pages on the same server.
This website doesn't show its favicon (thistle)
This website does show its favicon (greenman)
Two of my sites on the same server with the favicon in the same place of the site's directory. ??
The only thing I can figure is there was a problem converting the ico online and saving it on my MacBook Pro before uploading it to the server?
Any help or hints or thoughts are greatly appreciated.
Had the same problem. Found this great answer: https://stackoverflow.com/a/16375622/5359989
What worked for me was changing 'favicon.ico' to something unique such as 'myfavicon.ico' and referencing it in the html accordingly. Hope this works for you also.
Change this:
<link rel="icon" type="image/x-icon" href="favicon.ico"/>
To this:
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico"/>
Another reason why your favicon is not shown could be because you're viewing a cached version of your site.
Clear your cache and open the site again and you will see the favicon.
Chrome didn't like the fact my favicon.ico was a 64x64 image. I changed it to a 32x32 pixel image and it showed right up!
You're using a relative path in your href="" attribute. Change it to a root-relative path /favicon.ico or an absolute path http://yoursite.com/favicon.ico.
Not all icons are the same! I had this problem for a while and could never figure out why some browsers didnt show the icon. I knew with absolute certainty that the file existed where the link tag said it did. Eventually I discovered that, at least for Chrome and Opera, they WONT display some icons depending on the formats within the .ico file.
E.g. a .ico that has, only, 64x64 and 32x32 and 16x16 formats will display.
BUT a .ico that also has, IN ADDITION TO those above, 512x512 256x256, 128x128 and 48x48 formats, will NOT display.
That really looks like a browser issue but its curious that it affects more than one browser.
Anyhow the solution, for me at least, was to only include 64x64 and 32x32 and 16x16 formats.
I had the same issue but solved it in the following way.
In w3schools at the "HTML favicon" section it says:
To add a favicon to your website, either save your favicon image to the root directory of your webserver, or create a folder in the root directory called images, and save your favicon image in this folder. A common name for a favicon image is "favicon.ico".
In my case I had a project in express.js. In express one sets the root directory of static files with the command:
app.use(express.static('public'))
In my project, "public" seemed as the root directory for all my static files. So, I just had to add a folder named "image" inside "public" where I saved my "favicon.ico". Finally I linked the icon in my main template html file according to my project's directory tree:
<link rel="icon" type="image/x-icon" href="../../images/favicon.ico">
Notice that I don't have to refer to the public folder because it is set as root by my framework.
In summary I think that if one uses a simple html project with vanilla js the w3schools' guideline is straightforward. But, if you're using a framework like express, Django etc. you have to think carefully how does your framework serve your static files.
I can not get my favicon to display on chrome. url is http://www.videobtc.com.
I read other posts on the same question, the best solution was to use
I proceeded to use this and I am still getting nothing. Help would be greatly appreciated.
This is how I have my favicon set up.
<link rel="shortcut icon" href="unipartisan_favicon.gif" />
...in the header
unipartisan-favicon.gif is in the htdocs directory(XAMPP) which is the same directory as my .php files that link to it. Perhaps your file type is not correct.
This has worked on both Chrome and Firefox, which are the only ones I have tested on.
Edit: I think it may also be imperative that the file you are using as a favicon has an equal pixelation ie. 300x300, 20x20, 489x489, or in my case 2156x2156px. The browsers have automatically re-sized my favicon to fit properly.
Using converticon.com, I converted my icon png file into an ico file. I placed the following code in my head tags:
<link rel="shortcut icon" href="icons/icon.ico">
I double checked and the file is in the appropriate location. The image has read and write capabilities. I then loaded the page on my browser but I all I get is an empty square box with a dotted border. I'm using XAMPP server. Why isn't the image displaying?
Did you try testing this on multiple browsers? Different browsers handle favicons differently.
Here are some things you could try.
Clear Your Cache
Delete all references of your link in your favorites.
Clear the file cache in your browser.
Shut down all instances of your target browser.
Reopen your browser and navigate to your website.
Force Refresh
If you are using Mozilla Firefox then you should:
Navigate to your website
Navigate to the exact location of your fav icon eg. www.site.com/favicon.ico.
Right click in browser window and select refresh.
When this is done Firefox is forced to reload the icon instead of the cached version.
Default behaviour of browsers
A second method for specifying a favicon relies on using a predefined URI to identify the image: "/favicon.ico", which is relative to the server root. This method works because some browsers have been programmed to look for favicons using that URI thus I would recommend placing the favicon in the root instead and see if that works. (rename the icon to favicon.ico also).
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
Image Format
At times there is an issue with the format of the favicon. If you are experiencing a problem across all web browser you could convert the favicon to gif or png and see if that solves the problem.
Force browser to update favicon
You can force your browser to update your favicon by passing a URL parameter. Using the ver parameter, you can increment the version number each time you want to force the downloading of new files.
add this to your markup.
<link rel="shortcut icon" href="/favicon.ico?ver=2.0" type="image/x-icon"/>
In MAMP (assume XAMP is same/similar) you would do the following:
- With MAMP running/open, hit the "Stop" button.
- Then go to: File > Edit Template > Apache httpd.conf
- Comment out lines:
#Alias /favicon.ico "/Applications/MAMP/bin/favicon.ico"
#Alias /icons/ "/Applications/MAMP/Library/icons/"
- Place your favicon.ico file in your site's root directory
- Start MAMP
You can probably do all sorts of crazy stuff here. Never worried about favicons during development, personally.
BTW - you don't have to clear your browser's cache, entirely. Just browse to the favicon and refresh it.... localhost:8888/favicon.ico
Just put the favicon at the root of your site, such as "example.com/favicon.ico" (make sure it is named favicon.ico though), and remove the above mentioned link element altogether. Browsers will check this location for a favicon by default if no is present, even IE.
After you do this, be sure to clear your cache when testing.
Try adding type attribute. Example:
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
I'm showing favicons of websites in a list, as <img /> elements.
some websites serve them as:
<link rel="icon" type="image/x-icon" href="favicon.ico" />
and some serve them as:
<link rel="shortcut icon" href="favicon.ico" />
IE doesn't show the favicons images of those of don't have type="image/x-icon".
I cannot control how websites serves their favicons, so what can I do from my side?
I think the best thing to do is convert them to another format. If you are displaying the icons manually then you could download each, convert it with an image program, and upload it to your site.
If you're doing it automatically you'll need to look at whatever image-handling tools you get on the server-side. If you're using PHP, that'd be the GD or ImageMagick libraries. Just convert to PNG for example, and cache it on your site.
If IE doesn't display .ico files inline with a page, then it's unlikely you're gonna be able to make it display without doing some kind of processing. At the most simple level, you can just read the external images and serve them up as the right mime type, without converting them.
Put this in your apache config or .htaccess file:
AddType image/x-icon .ico
Unfortunately, doesn't seem to resolve the problem I have. IE fails to display all favicon.ico's in my list of links ( http://www.jerbils.info/wxlinks.php ) whereas all other browsers do (i.e. they display all favicon.ico's that exist). Interestingly, if I manually display a domain's favicon.ico in IE, the ones that aren't displaying in IE that do display in all other browsers appear as textual content as opposed to an image. The implication is that there is something about the files that IE doesn't like and consequently it is generating an onerror condition that is causing the default icon to be displayed.