Html 如何在网站中放置书签图标(favicon)

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

How to put a bookmark icon (favicon) in website

htmlcsswordpress

提问by Jeegar Patel

See the small logo/icon in the tab when you open any website in any browser?:

当您在任何浏览器中打开任何网站时,是否看到选项卡中的小徽标/图标?:

enter image description here
How can I put such logo/icon on my wordpress blog?

在此处输入图片说明
如何在我的 wordpress 博客上放置这样的徽标/图标?

回答by Kyle

This is called a favicon. You link to it in the head section of your HTML.

这称为favicon. 您可以在 HTML 的 head 部分链接到它。

You can read more about it here: http://www.w3.org/2005/10/howto-favicon

您可以在此处阅读更多相关信息:http: //www.w3.org/2005/10/howto-favicon

And view a list of Wordpress plugins that do the work for you here: http://wordpress.org/extend/plugins/tags/favicon

并在此处查看为您完成工作的 Wordpress 插件列表:http: //wordpress.org/extend/plugins/tags/favicon

回答by Graeme Leighfield

Two ways,

两种方式,

the first is use this plugin

第一个是使用这个插件

http://wordpress.org/extend/plugins/shockingly-simple-favicon/

http://wordpress.org/extend/plugins/shockingly-simple-favicon/

Or, if you really want to learn how it works. Open your theme folder (normally under wp-content -> themes -> your theme name) and then normally in the header.php file there is everythign that happens in the head of your pages.

或者,如果您真的想了解它是如何工作的。打开您的主题文件夹(通常在 wp-content -> 主题 -> 您的主题名称下),然后通常在 header.php 文件中,页面头部发生了所有事情。

Any where in the <head></head>place the following code...

<head></head>以下代码的任何位置...

<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">

Where /favicon, is the link to your favicon.ico.

其中 /favicon 是指向您的 favicon.ico 的链接。

To easily make a favicon, use the following link.

要轻松制作网站图标,请使用以下链接。

http://www.favicon.co.uk/

http://www.favicon.co.uk/

Hope this helps you learn how to do it and what the actual plugin does for you :)

希望这可以帮助您了解如何操作以及实际插件为您做什么:)

回答by Ernestas Stankevi?ius

Use plungin: http://wordpress.org/extend/plugins/shockingly-simple-favicon/

使用插件:http://wordpress.org/extend/plugins/shockingly-simple-favicon/

回答by Todd

You just need to put the image into a file named favicon.icoin your website's root directory (like www.stackoverflow.com/favicon.ico). Browsers request this file when a user visits your site and will show it in the tab or bookmarks. You can find more info on wikipediaor even use http://www.favicon.cc/to help you design the icon.

您只需要将图像放入favicon.ico网站根目录中命名的文件中(如www.stackoverflow.com/favicon.ico)。当用户访问您的网站时,浏览器会请求此文件,并将其显示在选项卡或书签中。您可以在维基百科上找到更多信息,甚至可以使用http://www.favicon.cc/来帮助您设计图标。

回答by sascha

There are two ways.

有两种方法。

  1. In your template header.phpfile, you have to add the favicon code: <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />

  2. or, you just put the favicon.ico into your www root. Apache has a configuration setting which will load this as default.

  1. 在您的模板header.php文件中,您必须添加网站图标代码:<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />

  2. 或者,您只需将 favicon.ico 放入您的 www 根目录。Apache 有一个配置设置,它将作为默认加载。