Html 在站点的标题中添加徽标
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4750027/
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
Adding a logo in site's header
提问by TopChef
I would like to add a logo on my site header. Currently, on Google Chrome, it is a blank white paper. How would I go about doing so? Here is the current HTML I am using for my site header. Any help would be much appreciated.
我想在我的网站标题上添加一个标志。目前,在谷歌浏览器上,它是一张白纸。我该怎么做?这是我用于站点标题的当前 HTML。任何帮助将非常感激。
<title>
<?php if ( is_home() ) { ?> <?php } ?>
<?php echo ucwords(wp_title('',true)); ?> <?php echo ucwords(get_bloginfo('name')); ?>
</title>
回答by fredley
I'm assuming you want to add a favicon. You can't put it in the <title>
. This useful toolshould help with generating an appropriate icon and give you the correct code to embed it in your site and instructions on where to add it.
我假设你想添加一个favicon。你不能把它放在<title>
. 这个有用的工具应该有助于生成适当的图标,并为您提供正确的代码以将其嵌入您的站点以及添加位置的说明。
回答by toofast1227
this will do,
<link href = "images/icon.gif" rel="icon" type="image/gif">
这会做,
<link href = "images/icon.gif" rel="icon" type="image/gif">
回答by Bloodhound
you could add the following code in the head section
您可以在 head 部分添加以下代码
<head>
<link rel="shortcut icon" type="image/x-icon" href="/path to your logo">
</head>
you have to change the logo in jpg, jpeg, gif, png into ico. you can use the following link for that purpose link
您必须将 jpg、jpeg、gif、png 中的徽标更改为 ico。您可以为此使用以下链接 链接