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
How to put a bookmark icon (favicon) in website
提问by Jeegar Patel
See the small logo/icon in the tab when you open any website in any browser?:
当您在任何浏览器中打开任何网站时,是否看到选项卡中的小徽标/图标?:
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.
要轻松制作网站图标,请使用以下链接。
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.ico
in 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.
有两种方法。
In your template
header.php
file, you have to add the favicon code:<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
or, you just put the favicon.ico into your www root. Apache has a configuration setting which will load this as default.
在您的模板
header.php
文件中,您必须添加网站图标代码:<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
或者,您只需将 favicon.ico 放入您的 www 根目录。Apache 有一个配置设置,它将作为默认加载。