What is favicon. ICO and how to create A favicon icon for your website? [Zz]

Source: Internet
Author: User

By Christopher Heng, thesitewizard.com

Some time back, I had an email from a visitor asking me how I managed to have thefreecountry.com's icon displayed next to my URL in his browser's location bar. in fact, had he checked carefully, He wocould also have noticed that the icon is also used in his "favorites" menu.

Internet Explorer ("ie") 5.0 and above has a facility where, if someone bookmarks your website (ie puts it in their "favorites" menu ), it associates a participant icon with your website in the bookmark. it tries to obtain that icon by first requesting for "favicon. ICO "from the directory of your web page. if it cannot find such a file, it will try to obtain it from the root directory of your website, failing which, it will simply use a default icon for the bookmark.

On the other hand, the favicon. ICO file is available, the icon will also be displayed beside your website name in the "favorites" menu, the location bar in IE, and if the user opens up the "favorites" folder, it will be the icon used for the link to your site.

Opera and Firefox (Get Firefox with Google Toolbar) also have the ability to use the favicon. ICO file. in fact, Firefox also accepts the file in other graphics formats, such as the PNG format. these browsers display the "favicon. ICO "in the location bar of the browser (the part that shows your website's address or URL ). safari, both the Mac OS X and the Windows versions, also loads the favicon. ICO file into the address bar if available.

Software requirements

If you have an windows icon Editor (which you may already have if you have purchased a programming language development system for Windows), you're all set.

All is not lost, however, if you do not have the above. simply pop over to thefreecountry.com's free resource editors and Icon editors page at http://www.thefreecountry.com/programming/resourceeditors.shtml and get yourself one. that page lists a few free icon editors and resource editors. just choose any of the icon editors that strikes your fancy and download it. alternatively, you can also download one of the other packages that contain a resource editor. resource editors are tools that programmers use to create and edit windows "Resources" like icons, cursors (ie, mouse pointers), menus, dialog boxes, etc. for our purpose here, you will only need to use the icon editor portion of such resource editors.

How to create a "favicon. ICO" File
  1. Create an image 16x16 pixels in size. yes, it is really small and you can't really draw much in it. you shoshould also restrict yourself to the standard Windows 16 colours, although I suspect that 256 colours will work fine.

    If you like, you can also create a 32x32 pixel icon, which will be scaled to size for the favorites menu and the location bar. you can even put both 16x16 and 32x32 pixel icons into the same icon file. windows will use the former for its menus and the latter when the user opens up a folder that is set to display large icons. it's probably not really necessary to do this if you can't be bothered.

  2. Save the image as an ico file (named "favicon. ICO", of course ).

  3. Upload it to your website. you don't need to upload one to every directory of your site if you don't want to waste space-simply put it in your root directory and the Web browsers that support favicons will be apparently locate it eventually. you can also upload it into your images directory, but you will need to modify your web pages if you do. see later in this article for more information on this.

Help! My web host doesn' t allow ICO files!

If your hosting company does not allow files with. ICO extension to be uploaded, you might try to work around und it by uploading it (in binary mode) with some other extension (like GIF ). once it's on your site, rename it using your FTP program to the correct extension.

Helping the browser locate the favicon. ICO File

If you have placed your favicon. ICO file in a location other than the current web directory (relative to your web page) or the root directory, you have to help your visitors 'browser locate the favicon file by specifying it with a tag like the following in the <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />

You shoshould Replace "/favicon. ICO "in the above example with the actual location of your favicon. ICO file, for example, "/images/favicon. ICO "if you have placed it in your"/images/"directory.

This step is optional if you have put your "favicon. ICO "file in the standard locations, that is, in the same directory as the Web page or in the root directory of your website. otherwise you will need to modify all your existing web pages to take advantage of the "favicon. ICO "facility.

How many people are bookmarking my website?

This "favicon. ICO "used to have an interesting side-effect. the side-effect applied whether or not you bothered to put a special "favicon. ICO "on your site. you used to be able to find out the number of IE 5 Users who bookmarked your site by simply counting the requests for "favicon. ICO "in your web server logs, since IE 5 only asked for the favicon. ICO file when a site was placed into the "favorites" menu. from the number of favicon. ICO requests, you cocould estimate the total number of people who bookmark your site by applying this formula: Number of IE 5 bookmarks divided by the fraction of your visitors using IE 5.

For example, if two-thirds of your visitors use IE 5 +, and you get 100 requests for the icon, simply divide 100 by two-thirds to get 150. this was by no means an accurate measure-it did not take into account numerous factors; but at least it was able to give you a hint of how useful people find your site.

However, this side effect is no longer relevant today. all the major browsers, Firefox (and its derivatives like Netscape, SeaMonkey, etc), opera and Safari load the favicon. ICO to display in your visitors 'web address bar whether they put your site in their favorites (or bookmarks) or not. I merely mention this "side-effect" in case you have heard from webmasters of old about the bookmarking issue, so that you won't deceive yourself when you see the large number of "favicon. ICO "requests in your web logs: those requests do not mean much anymore.

Miscellaneous matters

If you are testing your favicon file in Internet Explorer, and find that you're seeing an old version of your favicon. ICO file, you probably need to empty your browser's cache (and possibly restart the browser ). internet Explorer caches the favicon. ICO file in the "Temporary Internet Files" folder, so if you don't empty the cache, you'll probably continue to see your old version and not the new version that you're 've created. incidentally, this also means that if your visitors empty their cache, their copy of The favicon. ICO file that was associated with the bookmark of your site will also be lost.

In addition, you shocould note that IE's implementation of favicon support is not particle robust. there will be times it displays the favicon for your site, and other times when it won't. don't be too bothered about this. if you need to test that you implemented your favicon correctly, test it in the other browsers. if it works there, then it's probably done correctly. from experience, whether a site's favicon shows up in IE or not depends on so far variables that it's best regarded as a random occurrence. this applies both to you and your site's visitors, so there's no point obsessing over it.

Conclusion

The "favicon. ICO "facility is by no means essential to your website's operation. in fact, few people even notice its existence, and its really too small to put anything useful in it. however, creating one can save your site some bandwidth if you have created a custom 404 file not found error file-that file will be sent by your web server everytime there is a request for a nonexistent "favicon. ICO "file. perhaps more importantly, creating such an icon adds to the specified sionalism of your site, marking you as a web designer who attends to detail.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.