我可以通过哪些方式将 FAVICON 放入我的网站?
我在网上浏览不同网站将其网站图标放入网站的方式。 每当我尝试自己做这件事时,我都会“黑客攻击”,直到它突然决定起作用。
我想我这里有两个问题合而为一。
该网站如何添加其网站图标? - http://www.fbd.ie
我在其页面源代码中找不到 favicon.ico。
除了包含
之外,如何包含 favicon?
I was looking around the web at the way different sites put their favicon into the site. Whenever I try to do it myself I end up "hacking" until it just suddenly decides to work.
I suppose I have 2 questions in one here.
How is this site adding it's favicon? - http://www.fbd.ie
I can't find favicon.ico in it's page source.
Apart from including
<link rel="shortcut icon" href="/favicon.ico">
, how can I include a favicon?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
添加 favicon 最简单的方法就是将名为
favicon.ico
的文件放入网站的根目录中。浏览器会自动找到它。
您还可以专门放入
标记。 其中任何一个都可以:
编辑:我发现你已经知道了。 :D
The easiest way to add a favicon is to simply put a file named
favicon.ico
into the root directory of your web site.Browsers will find it automatically.
You can also specifically put in a
<link>
tag. Any of these will work:Edit: I see you knew that already. :D
favicon.ico
的文件。 大多数浏览器默认情况下都会查看那里,无论是否有标记。
favicon.ico
in the root directory of the website. Most browsers will just look there by default regardless of if there is a<link>
tag or not.您所要做的就是将该文件包含在站点的根目录中。 浏览器被设计为自动请求这一点 - 如果您没有这样的请求,您将在网络日志中看到大量对其进行 404ing 的请求!
来自维基百科:
重点是您不必在 HTML 标记或任何其他资源文件中执行任何操作。 只需将文件转储到根目录即可。
All you have to do is include the file in the root of your site. Browsers are designed to request this automatically - you will see a large number of requests for it 404ing in your web logs if you don't have one!.
From wikipedia:
The salient point is that you don't have to do anything in your HTML mark-up or any other resource file. Just dump the file in the root.