Implement Favicon - html

I want to implement a favicon and use this line in my index.html:
<link rel="shortcut icon" href="img/favicon.ico">
Am I doing something wrong or missing something else? It doesn't show me an icon in all browsers.

From my expirance,
Probably you need to poot it in root folder of your site
Refresh of your page msy be required (cnrl+f5)
Also, i think it should be "valid" icon (not renamed jpg...).

Related

Favicon not showing even after cache cleared

For some reason, the favicon just isn't showing. The website is gracedli.com.
You can see the favicon at gracedli.com/favicon.ico and my code to add it is (currently only on index.html):
<link rel="icon" href="favicon.ico" />
I've cleared the cache and used multiple different browsers, and for the life of me, I can't figure it out. Would love some help on it (everything's written in pure HTML/CSS so you can take a peek at the full code at the link). Thank you so much!
You have put the contents of <head> in <header> instead. Move them into , and that would possibly solve your problem.
Common reasons your Favicon is not showing
Check file path : You need to ensure that your favicon’s file path is correct.
The link of favicon is not at the right location : It is important to place the link to add your favicon in the head section of your webpage.
Syntax errors : A minor syntax error in the link of favicons could result in your favicon not showing.
When favicon file in the root directory, but not linked : Always put the favicon in the root directory, and name it favicon.ico. Almost all modern browsers look up /favicon.ico by default but make sure that you have these links in your head section:
link rel="SHORTCUT ICON" href="favicon.ico" type="image/x-icon" />
link rel=" bookmark" href="favicon.ico" type="image/x-icon" />
Because in many cases Just because the favicon file is in your root directory, it does not mean that it will automatically recognize.
Your browser has cached your site as one without a favicon : May be your browser has ‘saved’ your site as one without a favicon. You need to clear the cache in your browser or use a different browser.
May it helped to solve the issue…
Huge shout out to Timmy Chan (in the comments of the question) for noticing this, but I put my tags in <header> instead of <head>. Once I moved them, it worked!

Favicon.ico doesn't appear in title bar

I am trying to add a favicon.ico in my title but it is not working. The image and the HTML file are in the same folder but it still can't show me the favicon icon.
<title><link href="\Users\fjoni_000\Desktop\Stuff\Projects\Programming\favicon.ico" rel="shortcut icon">Best Of Internet | Front page</title>
This is the code that I am using. I tried with the Google logo and still it didn't show. This is the code from Google source code:
<link href="/images/branding/product/ico/googleg_lodp.ico" rel="shortcut icon">
If there is any question similar to mine and has the answer that I'm looking for then please comment it. Also the website is locally hosted NOT online
The <link> should not be within the <title>... it should be outside of the <title> but still within the <head>...
<head>
<title>Best Of Internet | Front page</title>
<link href="\Users\fjoni_000\Desktop\Stuff\Projects\Programming\favicon.ico" rel="shortcut icon">
...
Although I think the main issue you have is it looks like a local system path, not a URL as understood by your browser. And you're also missing the type attribute
Without knowing the setup of your website server... I would take a complete guess that you want something like...
<link href="/Programming/favicon.ico" rel="shortcut icon" type="image/x-icon" />
Just as an additional point, if you're able to... simply placing the favicon.ico file in the root of your domain is enough for the majority of browsers to pick up. Then you don't need the <link> at all
You could try to clear your browser cache and try again.
Do you have a live URL?
you adding Favicon inside the title tag which is wrong and make sure the icon exist in path. try this
<title>your title</title>
<link href="/images/branding/product/ico/googleg_lodp.ico" rel="shortcut icon">

Adding a favicon - not working

I try to add favicon to my site.
I am upload the favicon to directory index and I add this line to my header site:
<link rel="icon" href="http://example.com/favicon.ico">
Maybe its chache?
help me please :)
edit:
I am dont see request to favicon :O
http://i.stack.imgur.com/1DET3.png
Any-asnwer not working..
Maybe I need clear chache?
EDIT: THIS IS WORKING NOW, THANKS FOR ALL!
Try this,
<link rel="shortcut icon" href="http://example.com/favicon.ico" />
Try this code
<link rel='shortcut icon' type='image/x-icon' href='favicon.ico' />
Put your favicon icon on root directory.
Also ensure that the favicon icon exists at the url("http://example.com/favicon.ico")
Your favicon may be the wrong bit depth and/or size. Save your favicon as an 8bit (jpg is 8-bit, but png is better and you can save for web as 8-bit, it doesn't need to be .ico) image and make sure to clear your cache. On upload, it should show in all browsers. Save it as ideally 16x16 pixels
Do you see your favicon when opening http://example.com/favicon.ico ?
If you do, try to reload the page http://example.com/ with CTRL + R
Try this Sure it will work
<link rel="shortcut icon" type="image/png" href="/favicon.png"/>
<link rel="shortcut icon" type="image/png" href="http://eg.com/favicon.png"/>
There is another way you can do this
FoYou need to upload the favicon file “favicon.ico” to the server. To do so, point your browser address bar to your FTP server. Your URL might look similar to this:
“ftp: //username # websitedesign.com”
When you press enter, the browser will prompt you seeking an username and password. Once you get access to the root folder, upload your favicon file into it.
Now, you need to edit the HTML page of your website to help browsers fetch your favicon image while displaying your web page.
To do this, keep your FTP window open and download the “index.html” or “header.php” file from server and follow the steps below according to the file you get:
Now, insert the code below in the HEAD area of the “index.html” file, and change “yourwebsite.com” for your own website address.

Shortcut icon is not working

I'm creating an HTML web page.
I'm nowhere near finish and therefore should not focus too much on the following matter at the moment.
But I'm confused about why my code for the Shortcut icon is not working.
I'm testing everything by placing all files in the same folder (offline, no servers or anything similar)
The code is
<link rel="SHORTCUT ICON" type="image/x-icon" href="favicon.ico">
I tried with different ico files and it will only work with an ico uploaded to a website.
For example the following code will work.
<link rel="SHORTCUT ICON" type="image/x-icon" href="\WEBSITEFOLDER\favicon.ico">
Try:
<link rel="SHORTCUT ICON" type="image/x-icon" href="~/favicon.ico">
or:
<link rel="Shortcut Icon" type="image/ico" href="favicon.ico">
I ran into this similar problem, and it turned out that the size of the actual file was what caused the issue. According to sources it has to be either 16x16 or 32x32. I would use an icon generator like: x-iconeditor.com.
If you want a favicon on local file, you will have to use Data URI
See this answer : local (file://) website favicon works in Firefox, not in Chrome or Safari- why?
set favicon icon size 16x16 it will work in chrome...
I HAD the same problem. The site I "borrowed" from used a folder called "icons" for the location of the .ico file so I followed that exactly. The service my girlfriend used was Web.com. For whatever reason with Web.com if a shortcut icon in located anywhere other than the root directory, it will not show up in Internet Explorer. I simply moved the favicon file into the same place index.html was and changed that one line of code in the index to reflect that.
Solved (in my case anyway)! Good luck!
<link rel="icon" href="relative_PATH/favicon.ico">
Try to put the all relative path to the icons file
It doesn't work, absolutely because the link target is not correct.
If you put the icon in the same folder of your web page, then correct the link to the following:
<link rel="SHORTCUT ICON" type="image/x-icon" href="./favicon.ico">
which means favicon.ico is in the current folder.
However you can use the debugger i.e. chrome debugger and navigate to
the source code of your web page, i.e. right click on the link of your icon ->
open in new tab, and see how it works
Try to add the absolute route for the image icon and Use 48x48 px image size.
That worked for me
<link rel="shortcut icon" type="image/png" href="http://yoursite.com/Content/Images/favicon.png" />

Cannot get Favicon.ico to display

I have copied my favicon.ico file to my Apache document root. I had to add an Apache Rewrite exception for it and now it is accessible from www.example.com/favicon.ico. But when I hit my main URL it does not show up.
I thought all you had to do was copy the file with the correct permissions into the doc root? Do I need to make php changes? Thanks!
Try throwing this tag in the head of your document:
<link href="/favicon.ico" type="image/x-icon" rel="icon" />
IE and Firefox can behave differently (not sure which one you are using). Try to add the page as a bookmark, then click the bookmark (to load the page). After you do that exit your browser and see if the if shows up then.
If that does not work try to clear your browser cache and repeat the above steps that should fix it. I have seen your problem before!
the favicon.ico reference must be an absolute URL, not relative.
Using this:
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
My status was
favicon.ico () shows up in:
IE 9.0.8
Safari 5.1.7
Fails in:
FF 28.0
Google Chrome 34.0
changing to absolute values
<link rel="icon" href="http://127.0.0.1/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="http://127.0.0.1/favicon.ico" type="image/x-icon">
causes all browsers to locate and display the favicon.ico
Could it be that you uploaded the favicon after your browser has remembered that your domain doesn't have one and therefore doesn't issue a new request?
favicon icon behaves differently for different browswrs & sometimes if it works in FF & does not work in IE.
Try after Clearing the cache of the browser and standard code for favicon ico is,
Just put below tag in your index file OR whichever common file for your project.
<link rel="FaviconIcon" href="favicon.ico" type="image/x-icon">
Although new browsers support GIF and PNG images , but , I would suggest always saving the image as favicon.ico.
Try placing the ico file in an images folder in your root. That's where many browsers look for favicon. And that's something to keep in mind. Favicon is a very loose standard, if you can even call it that, which is supported by browsers, not by the server. The browsers themselves actually fetch favicons in separate calls to display on their favorites bars, or tabs... The favicon file just has to be placed somewhere that the browsers can find it.
Some browsers will pick up the icon if its in the root directory without adding anything to the page, however IE and FF don't. Add this code to the head section of your page
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
It seems like in Chrome that you cannot use a link (ex. https://) rather must you have the favicon.ico in the same folder as the index.html. For any other file, it seems to work with a link.