The favicon isn't working on my site. If I go to google.com/favicon.ico I see the image displayed. But for some reason on my site, lucasjohnson.co.uk/favicon.ico prompts me to download a file. I have even tried replacing my own favicon with Google's, but I still have the same problem.
Edit: The file ico file was converted from a png using Dynamic Drive's FavIcon Generator.
I checked http://www.lucasjohnson.co.uk/favicon.ico, and the response content-type is text/plain. There are several content types that can be used for favicon, but text/plain is not one of them.
The most common ones are image/x-icon and image/vnd.microsoft.icon.
So basically, just choose one of the following content types and add it to your link tag:
<link rel="icon" type="image/vnd.microsoft.icon" href="http://www.lucasjohnson.co.uk/favicon.ico" />
<link rel="icon" type="image/png" href="http://www.lucasjohnson.co.uk/favicon.ico" />
<link rel="icon" type="image/gif" href="http://www.lucasjohnson.co.uk/favicon.ico" />
<link rel="icon" type="image/x-icon" href="http://www.lucasjohnson.co.uk/favicon.ico" />
See http://en.wikipedia.org/wiki/Favicon for more details.
BTW, regardless (or not) of this problem, I've noticed that you're not closing one of your meta tags:
<meta name="viewport" content="width=device-width">
Related
My team are now developing a vue-cli based webapp that aims to works on Safari(iOS) and Chrome(android).
The favicon show normally on chrome but not showing in safari, or showing on some pages but not in some page.
I've figuring on this issue for like two weeks.
I tried to force refresh the favicon by ./favicon?v=2, or use full url path or relative path, or use several different way to write favicon, but nothing works.
Sometimes the favicon just show for a second and a disappear.
Some pages say the safari iphone can be heavily cached but i can't find a good way to clean the cache.
I use vue-cli so the below link tag is written in public/index.html like below, and the favicon in public/favicon.ico.
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
after build, above code become code like
<link rel="icon" href="https://www.mysitesite.com/favicon.ico">
chrome android or chrome pc show normally but not safari ios
I also tried some code like below but don't work.
<link rel="icon" href="https://www.mysitesite.com/favicon.ico?v=2" />
<link rel="icon" href="https://www.mysitesite.com/favicon.png?v=2" />
<link rel="icon" href="./favicon.ico?v=2" />
<link rel="icon" href="./favicon.ico?v=2" />
also, I tried generate favicon path by html-webpack-plugin but not show in safari.
apple-touch-icon shows when i bookmarked but favicon didn't show on the safari tab.
<link rel="apple-touch-icon" sizes="180x180" href="./apple-touch-icon-180x180.png">
Does anybody knows the solution or is this just a bug in safari?
Thank you so much.
I am facing one issue with favicon.ico. Here is my link rel code which has been included in header portion.
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
The problem is, I can view the favicon in all browsers if the url starts with http://. When the address starts with https://, the favicon is not showing in IE browser. Is there anything that I need to do? Did I miss anything important to include?
I had the same problem and fixed it by putting the following line in the head section of my html file:
<link rel="shortcut icon" href="">
I have a favicon on my page, and when i go to the link for the favicon: mypage/favicon.ico
It starts download, instead of just showing it as an online image (as every other site).
I've searched everywhere for a solution, but got no answer.
I want it to show, and not to be downloaded, what can be the problem?
<head>
<link rel="shortcut icon" href="/favicon.ico">
</head>
Its an .ico file at 32x32.
Thanks - Chris
You can show it in HTML as a regular image tag. This has been tested in Firefox 26, Chrome 29 and Internet Explorer 10. All with positive results. You can try on your own browsers if you'd like.
Code:
<!DOCTYPE html>
<html>
<body>
<img src = "logo.ico" type = "image/x-icon">
</body>
</html>
You should use
<head>
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
</head>
And consider to use another image e.g .png
<link rel="icon" href="/favicon.png" type="image/png" />
(Some Browsers does not support .ico)
If you call mypage/favicon.ico directly it might be dowloaded, depending on your http server/browser which mime type should be downloaded or displayed.
see Wikipedia.
I'm working on my very first (very lame) website, so apologies for the n00b question.
In Chrome/FF/Safari, my site renders the CSS fine. But on my iPhone or iPad (Chrome or Safari), my site renders as if there were no CSS styles at all. What's the cause?
Link to site
Thanks in advance!
you are referencing localhost for your stylesheet
<link rel="stylesheet" href="http://localhost:8888/kirbydev/assets/styles/styles.css" />
needs to be
<link rel="stylesheet" href="http://www.tvsonsale.co.uk/kirbydev/assets/styles/styles.css" />
or relative path so it works on local dev and production:
<link rel="stylesheet" href="/kirbydev/assets/styles/styles.css" />
If I specify different image sizes for favicon PNGs like so:
<link rel="icon" type="image/png" sizes="16x16" href="/favicon.png" />
<link rel="icon" type="image/png" sizes="24x24" href="/favicon-24px.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32px.png" />
<link rel="icon" type="image/png" sizes="48x48" href="/favicon-48px.png" />
<link rel="icon" type="image/png" sizes="64x64" href="/favicon-64px.png" />
<link rel="icon" type="image/png" sizes="256x256" href="/favicon-256px.png" />
<link rel="icon" type="image/png" sizes="512x512" href="/favicon-512px.png" />
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
Does every one of these files get fetched?
Quoting from http://www.jonathantneal.com/blog/understand-the-favicon/:
How do these PNG-favicon-compatible browsers determine which favicon
should be used? Firefox and Safari will use the favicon that comes
last. Chrome for Mac will use whichever favicon is ICO formatted,
otherwise the 32×32 favicon. Chrome for Windows will use the favicon
that comes first if it is 16×16, otherwise the ICO. If none of the
aforementioned options are available, both Chromes will use whichever
favicon comes first, exactly the opposite of Firefox and Safari.
Indeed, Chrome for Mac will ignore the 16×16 favicon and use the 32×32
version if only to scale it back down to 16×16 on non-retina devices.
Opera, not wanting to take sides, will choose from any of the
available icons at complete random. I love that Opera does this.
And that’s just the beginning. Now it’s time to learn about the
Internet Explorer caveats.
While IE8-10 will display
the favicon on first load of the page, IE7 will skip the first load
and display the favicon during repeat visits. Worse yet, IE6 will only
display the favicon once the site has been bookmarked and reopened in
the browser. IE6 will also drop the favicon whenever the browser cache
is cleared, and it will not display the favicon again until the site
is either re-bookmarked, or the favicon is somehow reloaded. If IE6
and favicons mean a lot to you, you can force this reload with a
little JavaScript snippet, preferably wrapped in a conditional
comment.
<!-- I "support" IE6 -->
<!--[if IE 6]><script>(new Image).src="path/to/favicon.ico"</script><![endif]-->
According to the specification, the most appropriate icon will be used. So there is no a need to fetch something that has no use.
If multiple icons are provided, the user agent must select the most appropriate icon according to the type, media, and sizes attributes.
Surprisingly, I observed that some browsers are loading all PNG favicons, not only the most suitable one:
Chrome on Windows
Chrome on Android
Firefox on Windows
I didn't tested other settings, like Firefox on Android.
More about the "all favicons are loaded" issue.
The browser will get only one file, if any.