【问题标题】:how can i add an image as a title, which appears in the title bar? [duplicate]如何添加图像作为标题,它出现在标题栏中? [复制]
【发布时间】:2014-06-30 23:38:52
【问题描述】:

我想知道如何添加图片徽标作为网站标题。例如,如果我们打开我们的 gmail,它会在标题栏中显示 gmail 徽标 如何做到这一点..

<title>
<img src="as.jpg"></img> Hello user 
</title>

【问题讨论】:

  • 嗨,它叫做 Favicon。
  • 请注意&lt;title&gt; element 应该只包含文本内容,而不是标记。
  • 谢谢,注意到 :) @PatrickHofman

标签: html


【解决方案1】:

您要查找的内容称为Favicon,不应与应仅包含文本的the title element 混淆。

假设您已将 favicon.png 保存在同一目录中,这样的事情会起作用。

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

您也可以添加标题,因此您的结果可能是这样的:

<head>
    <title>Awesome title</title>
    <link rel="shortcut icon" type="image/png" href="/favicon.png"/>
</head>

使用 .ico 文件也很常见,您可以轻松找到在线转换器。

【讨论】:

    猜你喜欢
    • 2013-03-25
    • 1970-01-01
    • 2014-01-20
    • 2017-03-11
    • 2011-09-18
    • 1970-01-01
    • 1970-01-01
    • 2020-10-10
    相关资源
    最近更新 更多