如何使用Meteor加载图标 [英] How to load a favicon with Meteor

查看:130
本文介绍了如何使用Meteor加载图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在试图弄清楚如何在我的流星应用程序中添加一个favicon。根据文档,我应该将它放在 / public 目录中,但实际上没有多少信息。我把我的 favicon.ico 文件放在那里并在我的html文件的标题中引用它,但是浏览器没有加载它。如果我打开chrome上的开发工具,它会显示文件加载(即转到 localhost:3000 / favicon.ico )。任何人对我可能缺少的东西都有任何建议吗?

I'm trying to figure out how to add a favicon to my meteor app. Per the docs I should put it in the /public directory, but there isn't really much more info than that. I put my favicon.ico file there and referenced it in the header of my html file, but the browser doesn't load it. If I open up the dev tools on chrome though, it shows the file loading (i.e., go to localhost:3000/favicon.ico). Anyone have any suggestions on what I might be missing?

推荐答案

它应该有效。可能是路径问题或本地主机上的缓存问题。

It should work. Probably either an issue with the path or caching on localhost.

以下是关联图标应该如何链接:

Here's how the favicon should be linked:

<link rel="icon" sizes="16x16 32x32" href="/favicon.ico?v=2">

(注意:开头的 / ;它很重要!)

(Note: the / in the beginning; its important!)

这篇关于如何使用Meteor加载图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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