如何在html中将图像添加到网站的标题中

时间:2018-03-14 15:32:57

标签: html image web title

<head>
  <title><!--i want to add a picture into the title--></title>
</head>

请帮助我们,我只使用html创建一个网站。我想知道如何将图片添加到浏览器中显示的标题

4 个答案:

答案 0 :(得分:0)

标题用于将页面标题显示为文本

您应该使用下面的应答器显示名为 logo.png 图标,例如:

<link rel="icon" type="image/png" href="logo.png" />

答案 1 :(得分:0)

您实际上需要在网站上添加图标。

<link rel="icon">
Simply add the following code to the <head> element:

<link rel="icon" href="http://example.com/favicon.png">

答案 2 :(得分:0)

您要添加的内容实际上是一个名为favicon的内容。这是一个您想在网站标题旁边添加的小图片。

有关favicon的更多信息,请参阅此文章:https://www.abeautifulsite.net/what-are-favicons

需要考虑的一些事项(摘自文章)

最喜欢的尺寸是:

  • 32×32
  • 48×48
  • 64×64 -128x128

您可以使用favicon generator将图片转换为正确的格式并下载。

下载您的收藏夹并将其放入您的html网站目录后,将以下代码插入您的头脑中。

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

答案 3 :(得分:0)

确保使用@Joshua所述尺寸的图标文件。插入以下代码。

<link rel="icon" href="....logo.ico?v=2" />

您需要添加 ?v = 2 查询字符串以强制刷新。否则,您可能会遇到缓存问题。

相关问题