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.

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

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

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

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

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

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

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.