What is Favicon.ico? Personalise Your Site's Bookmark
link:
http://www.thesitewizard.com/archive/favicon.shtml
by Christopher Heng,
thesitewizard.comSome 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 would 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 particular 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.
Mozilla, and probably also the new versions of Netscape (which are based on Mozilla), also have the ability to use the favicon.ico file, except that Mozilla also accepts the file in other graphics formats, such as the PNG format. It displays the "favicon.ico" in the location bar of the browser (the part that shows your website's URL). The latest version of Opera 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
-
Create an image 16X16 pixels in size. Yes, it is really small and you can't really draw much in it. You should 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.
-
Save the image as an ICO file (named "favicon.ico", of course).
-
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 IE will 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 the .ICO extension to be uploaded, you might try to work around 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 <head> section of your web page.
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
You should 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, ie, 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. From that number, you can 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. Mozilla, Netscape and Opera load the favicon.ico to display in your visitors' location bar whether they put your site in their favourites (or bookmarks) or not. Apparently the Mac OS X browser, Safari, also loads the favicon.ico file whenever it visits a site (it uses it in the history menu). I've not checked the latest version of IE so I'm not sure if it does the same too. I merely mention this "side-effect" so that you won't deceive yourself when you see the large number of "favicon.ico" requests in your web logs: it doesn't tell you that those your visitors bookmarked your site 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 possible 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'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.
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 professionalism of your site, marking you as a web designer who attends to detail.
分享到:
相关推荐
【favicon.ico 图标大全】是为了解决网页标识问题而提供的资源集合,它包含了各种流行、个性化的图标设计,适用于不同网站的需求。Favicon(Favorites Icon)是网站的图标,通常显示在浏览器的地址栏、书签栏以及...
Favicon.ico 介绍和制作技巧 Favicon.ico 是一个小图片,通常出现在浏览器的地址栏、标签页和收藏夹中,用于建立网站的品牌形象。制作 favicon.ico 图标需要两步:第一步,制作 16*16 像素的 favicon.ico 图片,并...
favicon.ico 很简单的一张图片 favicon.ico favicon.ico favicon.ico favicon.ico
favicon.ico 一般用于作为缩略的网站标志,它显示位于浏览器的地址栏或者在标签上,用于显示网站的 logo,如图红圈的位置, 目前主要的浏览器都支持 favicon.ico 图标. 如果要让网站看起来更专业、更美、更有个性,制造...
Favicon.ico远程获取插件 简介 Favicon.ico远程获取插件:远程实时获取并显示网站的Favicon.ico文件,美化网站外链显示效果。 适合网址导航网站,网站友情链接显示美化等。 Favicon.ico远程获取插件页面展示 ...
<link rel="shortcut icon" href="/path/to/your/favicon.ico" type="image/x-icon"> ``` 这里,`href` 属性应指向 favicon.ico 文件的实际路径,确保文件存储在网站的根目录或者可被服务器访问的路径下。 兼容性...
在Node.js中屏蔽favicon.ico请求的方法主要是通过修改路由处理逻辑来实现的。在Web开发中,favicon.ico是网页的图标,通常用于显示在浏览器标签页上。当用户访问网页时,浏览器会自动尝试获取该图标,除非服务器已经...
favicon.ico 一般用于作为缩略的网站标志,它显示位于浏览器的地址栏或者在标签上,用于显示网站的 logo,如图红圈的位置, 目前主要的浏览器都支持 favicon.ico 图标. 如果要让网站看起来更专业、更美、更有个性,制造...
在网页设计中,Favicon.ico是一个重要的元素,它代表了网站的图标,通常显示在浏览器的地址栏、书签列表以及标签页上,为用户提供直观的识别标识。本文将深入探讨一个基于PHP的Favicon.ico远程获取插件——"Favicon....
本文介绍在web.py中设置favicon.ico的方法: 如果没设置favicon,后台日志是这样的: 127.0.0.1:4133 - - [03/Sep/2015 18:49:53] "HTTP/1.1 GET /favicon.ico" - 303 See Other 由于浏览器会自动去获取这个文件,...
在线ICO图标制作Favicon.ico图片在线制作网站PHP源码+支持多种图片格式转换 favicon.ico一般用于作为缩略的网站标志,它显示位于浏览器的地址栏或者在标签上,用于显示网站的logo,如图红圈的位置, 目前主要的浏览器...
在本文中,我们将详细探讨如何在Nginx服务器配置中关闭对`favicon.ico`和`robots.txt`的错误日志记录,以及如何阻止对隐藏文件的访问。这有助于优化服务器性能,避免不必要的资源消耗。 首先,让我们了解`favicon....
Favicon.ico,即网站的小图标,是一种广泛应用于互联网中的网页元素,它通常显示在浏览器的标签页、地址栏和书签上。Favicon.ico文件一般放置在网站的根目录下,以便浏览器能够自动找到并使用。当网站的HTML代码中...
在Node.js项目中处理favicon.ico请求问题 标题和描述中提到的问题是,在使用Node.js开发Web应用程序时,时常会遇到由于浏览器默认行为而发起对favicon.ico文件的请求。这种情况通常会出现在页面加载时,浏览器会...
"favicon.ico"是网站的图标,通常显示在浏览器的地址栏或标签页上,为Swagger UI提供了独特的视觉标识。在API文档中,一个清晰的图标可以增加专业感并帮助用户快速识别页面。 "restful"和"restful_api"标签表明这个...
favicon.ico是网站的图标也是网站的头像,简单来说,就是让我们的网站更加好看。 本文主要给大家介绍了关于优雅处理Django中favicon.ico图标的相关内容,分享出来供大家参考学习,下面话不多说了,来一起看看详细的...
### 给自己的网站制作一个favicon.ico图标的实现方法 #### ICO图标的重要性 在现代网络环境中,网站不仅仅是一个信息展示的平台,它还是品牌形象的一部分。一个精心设计的网站往往会在细节处展现出其专业性和独特...