Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

What markup is the modern standard for adding a favicon to my site? What is the standard image format and size?

share|improve this question

migrated from stackoverflow.com Dec 5 '10 at 10:08

This question came from our site for professional and enthusiast programmers.

    
Why is this being voted to close? What's the down vote for? –  Moshe Dec 5 '10 at 10:08
    
The downvote is gone but I assume it is because this question could have been easily answered with a google search. –  John Conde Dec 5 '10 at 14:42
1  
@John Conde - The downvote was given on SO. I'm quite confused why. It's a decent question, even if easily googled. –  Moshe Dec 6 '10 at 20:41
add comment

6 Answers 6

To work in all browsers, .ico is preferred, as for the size, 32x32 is the most widely used, 16x16 also works (this is the actual size used in the browser in most places).

Also not in your question, they should be 8 or 24bit color depth.

It may be worth noting, if you plan on iWhatever users bookmarking your site, that's a separate <link> for the image, for example StackOverflow's:

<link rel="apple-touch-icon" href="http://sstatic.net/stackoverflow/img/apple-touch-icon.png">

Which is:
SO Touch Icon

share|improve this answer
add comment

You can use a tool like http://www.favicon.cc/ to importe a picture and convert it into a favicon, or just create it from scratch.

After that, if you name your file favicon.ico and put it at the root of your website, most of the web-browsers get it automatically.

But you can also explicitly declare it in your html files like this:

<link rel="shortcut icon" type="image/png" href="path/to/your/favicon.png" />

With the advantages to use other format than ico, use differents favicons on differents pages, put your favicon to an other place, use an other name than favicon etc.

share|improve this answer
add comment

http://en.wikipedia.org/wiki/Favicon

share|improve this answer
1  
+1 for offering the obvious and easy to find solution –  John Conde Dec 5 '10 at 14:41
add comment

Markup with full domain http path for IE and keep favicon in document folder:

<link rel="shortcut icon" href="http://www.your-site-domain/favicon.ico">

Standard image format:

  • .ico
  • 16 x 16 pixels
share|improve this answer
add comment

You don't need a link anymore, but it's useful. Instead, so long as you leave the file named favicon.ico (and it's an ico) in your root, it'll be used as the favicon.

share|improve this answer
add comment

I had a little trouble creating my .ico file with the GIMP, but this post gives detailed instructions. The trick appears to be saving as GIF format first to convert to an indexed colour table, and then convert that to ICO format.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.