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
Add Favicon to Website
提问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.ico
in the webroot.
只需favicon.ico
在 webroot 中放置一个名为的文件。
If you want to know more, please start reading:
如果您想了解更多,请开始阅读:
- Favicon on Wikipedia
- Favicon Generator
- How to add a Favicon by W3C(from 2005 though)
- 维基百科上的网站图标
- 图标生成器
- 如何通过 W3C 添加 Favicon(虽然从 2005 年开始)
回答by citruspi
- This is not done in PHP. It's part of the
<head>
tags in a HTML page. - 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.
- Adding it is easy. Just add an
.ico
image 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. - You can easily generate favicons here.
- 这不是在 PHP 中完成的。它
<head>
是 HTML 页面中标签的一部分。 - 该图标称为收藏夹图标。根据维基百科:
收藏夹图标(收藏夹图标的缩写),也称为快捷方式图标、网站图标、URL 图标或书签图标,是与特定网站或网页相关联的 16×16 或 32×32 像素方形图标。
- 添加它很容易。只需添加一个
.ico
16x16 像素或 32x32 像素的图像文件。然后,在网页中,添加<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
到<head>
元素。 - 您可以在此处轻松生成网站图标。