Html 如何在浏览器页面标题旁边的标签栏上放置图像?

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

How to put an image on the tab bar next to the title of the page on the browser?

imagehtmljsp

提问by Daniel Morgan

Hi I am wondering how to put an image on the tab bar same as this website that has placed its logo on the left side of its title. as following picture.

嗨,我想知道如何在标签栏上放置与此网站相同的图像,该网站已将其徽标放在其标题的左侧。如下图。

enter image description here

在此处输入图片说明

回答by Boaz - Reinstate Monica

It's called a faviconand it's set with a <link>tag in the document's headertag.

它被称为 afavicon并且它<link>在文档的header标签中设置了一个标签。

For example, Stack Overflow sets it with:

例如,Stack Overflow 将其设置为:

<link rel="shortcut icon" href="http://cdn.sstatic.net/stackoverflow/img/favicon.ico">
<link rel="apple-touch-icon" href="http://cdn.sstatic.net/stackoverflow/img/apple-touch-icon.png">

The first tag is the cross browser way of setting the icon for common desktop browsers. The second tag is meant for iOS devices.

第一个标签是跨浏览器设置常用桌面浏览器图标的方式。第二个标签适用于 iOS 设备。

回答by Justgrant2009

What I think you're referring to is called a Favicon. Here's a link that helps you make (or import an image) and then exports the favicon for you to use. Once you've downloaded the file, just place it on the root of your site directory.

我认为您所指的称为 Favicon。这是一个链接,可帮助您制作(或导入图像),然后导出网站图标供您使用。下载文件后,只需将其放在站点目录的根目录中即可。

http://www.favicon.cc

http://www.favicon.cc