Html 将网站图标添加到网站

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

Add Favicon to Website

htmlfavicon

提问by osg

Possible Duplicate:
HTML Title Image

可能重复:
HTML 标题图片

Can someone please tell me how to make icons appear on browser tabs in PHP?

有人可以告诉我如何使图标出现在 PHP 的浏览器选项卡上吗?

I want my icon to appear on the tabs when my site is being accessed.

当我的网站被访问时,我希望我的图标出现在选项卡上。

采纳答案by kapa

Simply put a file named favicon.icoin the webroot.

只需favicon.ico在 webroot 中放置一个名为的文件。

If you want to know more, please start reading:

如果您想了解更多,请开始阅读:

回答by citruspi

  1. This is not done in PHP. It's part of the <head>tags in a HTML page.
  2. That icon is called a favicon. According to Wikipedia:

    A favicon (short for favorites icon), also known as a shortcut icon, website icon, URL icon, or bookmark icon is a 16×16 or 32×32 pixel square icon associated with a particular website or webpage.

  3. Adding it is easy. Just add an .icoimage file that is either 16x16 pixels or 32x32 pixels. Then, in the web pages, add <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">to the <head>element.
  4. You can easily generate favicons here.
  1. 这不是在 PHP 中完成的。它<head>是 HTML 页面中标签的一部分。
  2. 该图标称为收藏夹图标。根据维基百科:

    收藏夹图标(收藏夹图标的缩写),也称为快捷方式图标、网站图标、URL 图标或书签图标,是与特定网站或网页相关联的 16×16 或 32×32 像素方形图标。

  3. 添加它很容易。只需添加一个.ico16x16 像素或 32x32 像素的图像文件。然后,在网页中,添加<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"><head>元素。
  4. 您可以在此处轻松生成网站图标。