You are here:Home arrow Home arrow Markup and Style arrow Favicon MIME type?
  • Narrow screen resolution
  • Wide screen resolution
  • Decrease font size
  • Default font size
  • Increase font size
  • default color
  • green color
  • blue color

Favicon MIME type?

Friday, 17 June 2011

As with all files on the Internet, each needs to have a MIME type assigned. It is the responsibility of webmasters to make sure their files are properly served. With "text/*" MIME, browsers / search bots respect the MIME type provided and treat files as html or text content. Favicons also needs correct MIME type in order to be used by browsers.

But there is the confusion - many sources on the web point to make use of different types for favicon.ico files. It seems there is no strict standard, although each webmaster is interested in wider browsers' coverage.

One can specify favicon mime type by providing it in attribute, i.e.

<link rel="shortcut icon" type="image/x-icon" src="..." />

The type attribute specifies the MIME type for the linked resource. All browsers understand image/x-icon, but this is only correct if referring to an actual .ico-formatted favicon. If your favicon is formatted as .gif, .jpg, or .png, the correct MIME type is image/ico, as represented by type="image/ico".

The rel attribute tells the browser the purpose of the linked resource. All browsers understand a rel value of shortcut icon, but only certain non-IE browsers such as Mozilla and Opera correctly interpret a rel value of icon. Thus, using rel="shortcut icon" is optimal.

MIME type of "image/vnd.microsoft.icon" is by Microsoft and it is no good to use it.

Concluding, the best MIME type for favicon is "image-x-icon" and make sure to use actual .ico files - since IE 6 does not understand other formats.





Reddit!Del.icio.us!Facebook!Slashdot!Netscape!Technorati!StumbleUpon!
Last Updated ( Monday, 20 June 2011 )

Add comment


Security code
Refresh

< Prev   Next >