在标题栏中添加图像 [英] Add image in title bar

查看:180
本文介绍了在标题栏中添加图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在标题栏中添加图片?

How do i add image in title bar?

我有title-Webnet

I have title- "Webnet"

它与FontAwesome Glyphicon的图标图标为 -

Merging it with a FontAwesome Glyphicon's icon images as-

<title><i class="icon-user icon-black"></i>Webnet</title>

我尝试用图片来源替换 -

And i tried it replacing with image source-

<title><img src="assests/img/user-Hermosillo.png" ></img>Webnet</title>

但标题显示的是innerHTML,而不是显示图片。

But title shows innerHTML instead of showing image there.

任何帮助?

推荐答案

< title> 仅支持纯文本。您将需要创建一个 .ico 图像,文件名为 favicon.ico ,并将其保存到根文件夹

That method will not work. The <title> only supports plain text. You will need to create an .ico image with the filename of favicon.ico and save it into the root folder of your site (where your default page is).

或者,您可以将图标保存到任何您想要的地方,并调用它任何你想要的,但只需将以下代码插入您的HTML的< head> 部分并引用您的图标:

Alternatively, you can save the icon where ever you wish and call it whatever you want, but simply insert the following code into the <head> section of your HTML and reference your icon:

<link rel="shortcut icon" href="your_image_path_and_name.ico" />

您可以使用Photoshop(带插件)或GIMP $ c> .ico 文件,或者您可以使用 IcoFX ,这是我个人最喜欢的,因为它很容易使用和做得很好(您可以从 download.com 免费获得该软件的旧版本)。

You can use Photoshop (with a plug in) or GIMP (free) to create an .ico file, or you can just use IcoFX, which is my personal favourite as it is really easy to use and does a great job (you can get an older version of the software for free from download.com).

更新:
您还可以使用一些在线工具来创建favicon,例如 ConvertIcon ,我已成功使用。还有其他免费的在线工具,现在也可以,这样做(通过简单的Google搜索可访问),但也生成其他图标,如Windows 8/10开始菜单图标和iOS应用程序图标。

Update: You can also use a number of online tools to create favicons such as ConvertIcon, which I've used successfully. There are other free online tools available now too, which do the same (accessible by a simple Google search), but also generate other icons such as the Windows 8/10 Start Menu icons and iOS App Icons.

这篇关于在标题栏中添加图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆