Html 如何在我的网站的网站选项卡旁边创建小图标?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7865695/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I create the small icon next to the website tab for my site?
提问by puissant
I've been wondering how to code something I don't know what it's called. Basically, (I don't have enough reputation to insert an image), it's the little icon next to your tab showing what website you're on. Like on facebook it's the "f" with blue background and google is the "g" with the colors... :\
我一直在想如何编码一些我不知道它叫什么的东西。基本上,(我没有足够的声誉来插入图像),它是选项卡旁边的小图标,显示您所在的网站。就像在facebook上一样,它是带有蓝色背景的“f”,而谷歌是带有颜色的“g”......:\
Could anyone please help me with how to implement it on my website and what it's called? Thanks so much
任何人都可以帮助我如何在我的网站上实施它以及它的名称吗?非常感谢
回答by profanis
It is called favicon.ico and you can generate it from this site.
它被称为 favicon.ico,您可以从该站点生成它。
回答by Bakudan
This is for the icon in the browser (most of the sites omit the type):
这是浏览器中的图标(大多数网站省略类型):
<link rel="icon" type="image/vnd.microsoft.icon"
href="http://example.com/favicon.ico" />
or
或者
<link rel="icon" type="image/png"
href="http://example.com/image.png" />
or
或者
<link rel="apple-touch-icon"
href="http://example.com//apple-touch-icon.png">
for the shortcut icon:
对于快捷方式图标:
<link rel="shortcut icon"
href="http://example.com/favicon.ico" />
Place them in the <head></head>
section.
将它们放在该<head></head>
部分中。
Edit may 2019 some additional examples from MDN