为什么我的图标不显示? [英] Why does my favicon not show up?
本文介绍了为什么我的图标不显示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
< link rel =icontype = img / icohref =img / favicon.ico>
但是,图标不显示。为什么?
注意:
我已确认该文件在正确的路径上位于磁盘上。 / p>
解决方案
- 它真的是
.ico
,或者只是名为.ico? - 您正在测试什么浏览器?
有一个favicon的绝对最简单的方法是在根文件夹中放置一个名为favicon.ico的图标。
如果您必须在子目录中使用它,请使用:
< link rel =快捷图标href =/ img / favicon.ico/>
在<$ c $前注意 /
c> img 以确保它锚定到根文件夹。
The following is used to set the favicon in my html code:
<link rel="icon" type="img/ico" href="img/favicon.ico">
However, the icon does not show. Why?
Note:
I have confirmed that the file is on-disk at the correct path.
解决方案
- Is it really a
.ico
, or is it just named ".ico"? - What browser are you testing in?
The absolutely easiest way to have a favicon is to place an icon called "favicon.ico" in the root folder. That just works everywhere, no code needed at all.
If you must have it in a subdirectory, use:
<link rel="shortcut icon" href="/img/favicon.ico" />
Note the /
before img
to ensure it is anchored to the root folder.
这篇关于为什么我的图标不显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文