看下面的文档就可以了解一些了:Standardization The original favicon feature was created by Microsoft and Microsoft's Internet Explorer web browser would request a favicon from a set URL (/favicon.ico) on every website. Microsoft's supported format for the link tag did not conform to the World Wide Web Consortium (W3C) HTML recommendation[1] because:The rel attribute must contain a space-delimited list of link types, so a two-word link type would not be understood correctly by conforming web browsers. The ".ico" file format (a raster format used for icons on Microsoft Windows) did not have a registered MIME type and wasn't likely to be automatically understood by most web browsers. In 2003, however, the format was registered with the Internet Assigned Numbers Authority (IANA) under the MIME type image/vnd.microsoft.icon, eliminating the first part of this problem. The use of a reserved location on a website conflicts with the Architecture of the World Wide Web and is known as link squatting or URI squatting. The Mozilla web browser added support for favicons in a way that conformed to web standards through the use of rel="icon" and letting web designers add favicons in any supported graphics format, e.g. <link rel="icon" type="image/png" href="/path/image.png">. Most web browsers have since added support for this feature and it should be used for all new content.In the past, to ensure that the favicon did indeed appear, various measures were taken by web designers and developers. There is no known guarantee that favicons will appear on all computers, even on the same browsers with the same versions.Another limitation of the code below is that it may associate a favicon with a specific HTML or XHTML document or directory. The favicon.ico file should be placed in the root directory to avoid this. A favicon.ico located in the document root directory (the default location established by Internet Explorer) will be automatically found by most browsers without the need to include the code below, though a icon/image file referenced by a link tag, if different, should take precedence.It has been suggested that both of the following HTML lines should be included: <link rel="shortcut icon" href="http://example.com/favicon.ico" type="image/vnd.microsoft.icon" /> <link rel="icon" href="http://example.com/favicon.ico" type="image/vnd.microsoft.icon" /> Only the former is necessary, however, as 'shortcut icon' will be treated as a list of possibilities by standards-compliant browsers (with "shortcut" being ignored, and "icon" used); while Internet Explorer will treat it as a single name ("shortcut icon"). The result is that all browsers understand the code. It is only necessary to include a second piece of code if one desires to offer an alternative image to modern browsers (e.g. an animated GIF or PNG). The link elements must be inside the head element (between <head> and </head>) in the HTML. The href can, but need not, point to the location /favicon.ico. It could point to any URL. Relative URLs may also be used. The .ico file format will be read correctly by all browsers that can display favicons. The image can usually be in any image format supported by the web browser. Configure the web server to send the correct MIME identifier: ICO files image/vnd.microsoft.icon (Alternatively, image/x-icon can be used instead, for compatibility reasons. It is preferred, however, to use the IANA-registered MIME type, as most major browsers now support it.) GIF files image/gif PNG files image/png Use the appropriate resolution and color depth. ICO: include one or more resolutions and color depths. The most common resolutions used are 16×16 and 32×32, with 24x24, 64×64 and 128×128 sometimes used by Windows and/or Mac OS X). Typically, only the 16x16 pixel version will be used in the browser's address bar, but other resolutions may optionally be included for other applications of the favicon. Color depths used are usually 4, 8, 16 & 24 bpp (i.e. 16, 64, 256 and 16 million colors). 32-bit, with full transparency, is also supported by many modern browsers and operating systems, though some older browsers may not understand it. GIF: use 16×16 in 256 colors. PNG: use 16×16 in either 256 colors or 24-bit.
不同意,不仅仅是一个文件名就好了,对于文件的尺寸、色深都是有要求的,不信你放个300*300,32位色的上去看看~~ICO: include one or more resolutions and color depths. The most common resolutions used are 16×16 and 32×32, with 24x24, 64×64 and 128×128 sometimes used by Windows and/or Mac OS X). Typically, only the 16x16 pixel version will be used in the browser's address bar, but other resolutions may optionally be included for other applications of the favicon. Color depths used are usually 4, 8, 16 & 24 bpp (i.e. 16, 64, 256 and 16 million colors). 32-bit, with full transparency, is also supported by many modern browsers and operating systems, though some older browsers may not understand it.
在这里告诉你,并不是你的方法不正确
你可以吧缓存全部删除了
然后就可以了
------------
也就是说你吧favicon.ico直接放根目录就可以了
PS:我刚测试过了,也是遇到你说的情况,--(不行)然后:删除缓存就ok了
www.cscrm.net/demo
<link rel="icon" href="./favicon.ico" type="image/x-icon" />
你可以看看我的效果可以嘛,
我就是直接放favicon.ico到根目录的
将图像存改名xx.ico,href="路径
<link rel="SHORTCUT ICON" HREF="favicon.ico">
如果再加入以下代码:<LINK REL="Book" HREF="favicon.ico">就可以在收藏夹中显示出你的图标了:)
图标的大小为16*16,32*32,48*48三种格式(以像素为单位),在收藏夹里出现的是16*16
如果还有不明白,看看这里:
http://www.csdn.net/expert/topic/615/615740.xml?temp=.8126947
不行啊,兄弟。在IE7里就看不见。在FireFox可以看见。
不行啊,兄弟。在IE7里就看不见。在FireFox可以看见。
ps: laosan 这个ID好象挺久的了
The original favicon feature was created by Microsoft and Microsoft's Internet Explorer web browser would request a favicon from a set URL (/favicon.ico) on every website. Microsoft's supported format for the link tag did not conform to the World Wide Web Consortium (W3C) HTML recommendation[1] because:The rel attribute must contain a space-delimited list of link types, so a two-word link type would not be understood correctly by conforming web browsers.
The ".ico" file format (a raster format used for icons on Microsoft Windows) did not have a registered MIME type and wasn't likely to be automatically understood by most web browsers. In 2003, however, the format was registered with the Internet Assigned Numbers Authority (IANA) under the MIME type image/vnd.microsoft.icon, eliminating the first part of this problem.
The use of a reserved location on a website conflicts with the Architecture of the World Wide Web and is known as link squatting or URI squatting.
The Mozilla web browser added support for favicons in a way that conformed to web standards through the use of rel="icon" and letting web designers add favicons in any supported graphics format, e.g. <link rel="icon" type="image/png" href="/path/image.png">. Most web browsers have since added support for this feature and it should be used for all new content.In the past, to ensure that the favicon did indeed appear, various measures were taken by web designers and developers. There is no known guarantee that favicons will appear on all computers, even on the same browsers with the same versions.Another limitation of the code below is that it may associate a favicon with a specific HTML or XHTML document or directory. The favicon.ico file should be placed in the root directory to avoid this. A favicon.ico located in the document root directory (the default location established by Internet Explorer) will be automatically found by most browsers without the need to include the code below, though a icon/image file referenced by a link tag, if different, should take precedence.It has been suggested that both of the following HTML lines should be included:
<link rel="shortcut icon" href="http://example.com/favicon.ico" type="image/vnd.microsoft.icon" />
<link rel="icon" href="http://example.com/favicon.ico" type="image/vnd.microsoft.icon" />
Only the former is necessary, however, as 'shortcut icon' will be treated as a list of possibilities by standards-compliant browsers (with "shortcut" being ignored, and "icon" used); while Internet Explorer will treat it as a single name ("shortcut icon"). The result is that all browsers understand the code. It is only necessary to include a second piece of code if one desires to offer an alternative image to modern browsers (e.g. an animated GIF or PNG).
The link elements must be inside the head element (between <head> and </head>) in the HTML.
The href can, but need not, point to the location /favicon.ico. It could point to any URL. Relative URLs may also be used.
The .ico file format will be read correctly by all browsers that can display favicons.
The image can usually be in any image format supported by the web browser.
Configure the web server to send the correct MIME identifier:
ICO files image/vnd.microsoft.icon (Alternatively, image/x-icon can be used instead, for compatibility reasons. It is preferred, however, to use the IANA-registered MIME type, as most major browsers now support it.)
GIF files image/gif
PNG files image/png
Use the appropriate resolution and color depth.
ICO: include one or more resolutions and color depths. The most common resolutions used are 16×16 and 32×32, with 24x24, 64×64 and 128×128 sometimes used by Windows and/or Mac OS X). Typically, only the 16x16 pixel version will be used in the browser's address bar, but other resolutions may optionally be included for other applications of the favicon. Color depths used are usually 4, 8, 16 & 24 bpp (i.e. 16, 64, 256 and 16 million colors). 32-bit, with full transparency, is also supported by many modern browsers and operating systems, though some older browsers may not understand it.
GIF: use 16×16 in 256 colors.
PNG: use 16×16 in either 256 colors or 24-bit.
The most common resolutions used are 16×16 and 32×32, with 24x24, 64×64 and 128×128 sometimes used by Windows and/or Mac OS X).
Typically, only the 16x16 pixel version will be used in the browser's address bar, but other resolutions may optionally be included for other applications of the favicon.
Color depths used are usually 4, 8, 16 & 24 bpp (i.e. 16, 64, 256 and 16 million colors).
32-bit, with full transparency, is also supported by many modern browsers and operating systems, though some older browsers may not understand it.
直接你再你站点的根目录下放favicon.ico这个文件就可以了
直接你再你站点的根目录下放favicon.ico这个文件就可以了
但IE收藏夹里有的出现
个人认为IE在这方面支持显然不好!IE许多不是用的开放标准或W3c标准
firefox这方面支持就很好,只要告诉是icon就行了,图形不限
ie6支持的不太好.ie7和ff都没问题