Html 如何在浏览我的页面时在浏览器的地址栏中添加图片?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/626371/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-28 23:24:29  来源:igfitidea点击:

How can I add a picture in address bar of the browser when my page is browsed?

htmlfavicon

提问by praveenjayapal

Duplicate:

复制:

Image icon beside the site URL

What is currently the best way to get a favicon to display in all browsers that support Favicons?

Preferred way to use favicons?

网站 URL 旁边的图像图标

目前在所有支持 Favicon 的浏览器中显示 Favicon 的最佳方法是什么?

使用收藏夹图标的首选方式?

I want to add my logo in the address bar of the browser, whenever it is browsed.

我想在浏览器的地址栏中添加我的徽标,无论何时浏览。

How do I make a favicon?

我如何制作网站图标?

回答by Paul Dixon

You need a favicon- this is a 16x16 image in .icoformat stored as favicon.ico in the root directory your site. Some browsers do support other formats too.

您需要一个favicon- 这是一个.ico格式的 16x16 图像,作为 favicon.ico 存储在您站点的根目录中。一些浏览器也支持其他格式。

A newer, more standards based approach is to include something like this in your html head:

一种更新的、更基于标准的方法是在你的 html head 中包含这样的内容:

<link rel="icon" type="image/png" href="/path/image.png"/>

See also this document from W3C: How to Add a Favicon to your Site

另请参阅 W3C 的此文档:如何向您的站点添加 Favicon

You might also want to refer to these other answers to the question:

您可能还想参考这个问题的其他答案:

回答by Joe

That image is called a favicon and here are some links on how to add one or you can just google "how to add a favicon" for more information.

该图像称为收藏夹图标,这里有一些有关如何添加收藏夹的链接,或者您可以在谷歌上搜索“如何添加收藏夹图标”以获取更多信息。

http://www.w3.org/2005/10/howto-favicon

http://www.w3.org/2005/10/howto-favicon

http://www.clickfire.com/favicon-tutorial

http://www.clickfire.com/favicon-tutorial

http://essentialkeystrokes.com/tutorial-how-to-create-your-own-favicon

http://essentialkeystrokes.com/tutorial-how-to-create-your-own-favicon

回答by Dave Webb

Are you talking about creating a Favicon?

您是在谈论创建Favicon吗?

If so, here's a sitewhich will help you make one.

如果是这样,这里有一个可以帮助您制作的网站