How can I put favicon to my website?

February 22, 2011 - 00:54:01

I would like to add favicon to my website, how can I do this?
Martin Riggs

1 Answer

Martin Riggs
October 23, 2010 - 08:38:54
I solved that and writing my answer here fellas...

First of all, you have to create your icon image. Your image file must be 16x16 pixels or 32x32 pixels, and 8-bit or 24-bit colors. The format of the image must be PNG, GIF or ICO. As PNG is a W3C standard for a long time, preferably it should be PNG. If you don't want to waste your time with creating icon, you should search google for "favicon generator" and you will find many online favicon generators.

After creating your icon, you can add it to your site with these two methods;
1- (Preffered) Use of these rel attribute in between <head>..</head> tags
<link rel="icon" href="" type="image/x-icon" />
<link rel="shortcut icon" href="" type="image/x-icon" />

Don't forget to replace URL with your site's icon url.

2- Predefined URL
If you put your icon under your site's root directory with "favicon.gif", "favicon.png" or "favicon.ico" name, browsers will automatically find and show it.

That's all, hope it helps :)
Please Sign up or Login to answer questions