I have a few static pages
that are just pure HTML, that we display when the server goes down. How can I put a favicon that I made (it's 16x16px and it's sitting in the same directory as the HTML file; it's called favicon.ico) as the "tab" icon as it were. I have read up on Wikipedia and looked at a few tutorials and have implemented the following:
<link rel="icon" href="favicon.ico" type="image/x-icon"/>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
But it still doesn't want to work. I am using Chrome to test the sites. According to Wikipedia .ico is the best pic format that runs on all browser types.
Update
I could not get this to work locally although the code checks out it will only really work properly once the server started serving the site. Just try pushing it up to the server and refresh your cache and it should work fine.
I know its older post but still posting for someone like me. This worked for me
put your favicon icon on root directory..
You can make a 16x16 .png and then use one of the following snippets between the
<head>
tags of your static HTML documents:Most browsers will pick up
favicon.ico
from the root directory of the site without needing to be told; but they don't always update it with a new one right away.However, I usually go for the second of your examples:
as an additional note that may help someone some day.
You can not echo anything to the page before:
will not load ico
works fine
This worked for me