首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在简单Meteor应用程序中使用Glyphicons?

如何在简单Meteor应用程序中使用Glyphicons?
EN

Stack Overflow用户
提问于 2014-08-07 15:14:07
回答 1查看 1K关注 0票数 0

我不知道如何在简单的Meteor应用程序中使用Glypicons:

  1. meteor create meteor-intro
  2. cd meteor-intro
  3. meteor (运行该应用程序,它运行得很好)
  4. meteor add bootstrap-3
  5. 将这些文件夹复制到流星应用程序文件夹Downloads\glyphicons_pro\glyphicons_pro\glyphicons\web\html_css\css Downloads\glyphicons_pro\glyphicons_pro\glyphicons\web\html_css\fonts Downloads\glyphicons_pro\glyphicons_pro\glyphicons\web\html_css\images中。
  6. 将meteor-rein.html的内容替换为以下内容:

流星应用程序运行,但图标没有呈现。我怎样才能让他们渲染??

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-08-07 16:12:07

您应该将字体和图像放置在Meteor /public文件夹中,然后将.css文件的@font-face属性中url的相对路径更改为指向它们的位置。

因此,如果来自Meteor应用程序主文件夹的新的相对文件路径变为public/glyphicons_pro/glyphicons/web/html_css/fonts,则将@font-face属性更改为对应于公用文件夹中的位置:

代码语言:javascript
复制
@font-face {
  font-family: 'Glyphicons Regular';
  src:
    url('/glyphicons_pro/glyphicons/web/html_css/fonts/glyphicons-regular.eot');
  src:
    url('/glyphicons_pro/glyphicons/web/html_css/fonts/glyphicons-regular.eot?#iefix') format('embedded-opentype'),
    url('/glyphicons_pro/glyphicons/web/html_css/fonts/glyphicons-regular.woff') format('woff'),
    url('/glyphicons_pro/glyphicons/web/html_css/fonts/glyphicons-regular.ttf') format('truetype'),
    url('/glyphicons_pro/glyphicons/web/html_css/fonts/glyphicons-regular.svg#glyphiconsregular') format('svg');
  font-weight: normal;
  font-style: normal;
}

您应该将.css文件放在Meteor目录的一部分中,其中仅在客户端提供。

*并从您的链接删除-文件是自动加载在您的应用程序,一旦他们被放置在适当的目录。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25186110

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档