如何将Bootstrap Glyphicons设置为网站的快捷图标

5
如何将Bootstrap Glyphicons设置为快捷图标?
对于网站,我们使用以下代码:
<link rel="shortcut icon" href="images/logo-small.jpg">

如何将 Bootstrap Glyphicons 设置为 glyphicon glyphicon-cloud 的网站图标快捷方式。

尝试 <link rel="shortcut icon" type="image/x-icon" href="images/logo-small.jpg" /> - mahendra rajeshirke
href="images/logo-small.jpg"> 正常工作,但我想将 glyphicon glyphicon-cloud 设置为我的 shortcut icon,而不是使用 images 文件夹中的可用图像。 - xrcwrn
2个回答

10

直接做不到。Twitter Bootstrap图标是一个Web字体,而快捷方式图标需要是一张图片。

使用图片编辑器手动创建favicon图标文件。

更新:Bootstrap图标来自Glyphicons,他们的免费下载包中包括Bootstrap云图标的PNG格式。您需要将其制作成16x16像素(普通分辨率)或32x32像素(Retina显示屏)的PNG格式,然后就可以像您已经知道的那样进行引用:

<link rel="shortcut icon" href="images/cloud.png">

@xrcwrn 我不知道这是否对你有帮助,但这是一个很好的答案,对我也很有效...如果它对你有帮助,请不要忘记将其标记为答案! :-) - joshmcode

0
在Bootstrap官网的文档中,他们提供了各种Glyphicons图标的类。 在这里,您只需将它们的Glyphicons图像包含在项目的资源文件夹中。 他们提供的各种类包括 icon-glass,icon-music,icon-search,icon-envelope等等... 在这里,您只需在HTML页面中添加即可。
//it is for search icon
<i class="icon-search "></i>

//it is for user icon
<i class="icon-user "></i>

请在 Bootstrap 网站上查找 glyphicon-cloud 的图标名称,或者您可以在 CSS 文件中查找。 - Oomph Fortuity

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接