Favicon: .ico or .png / correct tags?

Richard picture Richard · May 25, 2011 · Viewed 327.3k times · Source

In a HTML5 document, which favicon format do you recommend and why? I want it to be supported by IE7 and all the modern browsers.

Also, when using .png, do I need to specify the type (type="image/png")?

Answer

Ibu picture Ibu · May 27, 2011

For compatibility with all browsers stick with .ico.

.png is getting more and more support though as it is easier to create using multiple programs.

for .ico

<link rel="shortcut icon" href="http://example.com/myicon.ico" />

for .png, you need to specify the type

<link rel="icon" type="image/png" href="http://example.com/image.png" />