首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Icomoon.ttf未加载

Icomoon.ttf未加载
EN

Stack Overflow用户
提问于 2016-04-02 01:01:06
回答 1查看 2K关注 0票数 0

我遇到了一个图标字体的问题。我根本不能加载它们。但是,例如,如果我点击这个url:

localhost:8080/assets/fonts/icomoon.ttf (我正在处理的项目)

我可以把icomoon.ttf下载到我的电脑上。如果将它们安装在我的pc上,一切都很好。Icomoon字体工作。但这不是一个解决方案。

我怎么才能让它工作呢?我的相对路径似乎是正确的

这是我的结构的一个例子:

代码语言:javascript
复制
 index---
        |
      assets
          |_css
          |     |---icomoon.css
          |
          |_fonts
               |icomoon files

这是我的icomoon.css,供您查看:

代码语言:javascript
复制
@font-face {
  font-family: 'icomoon';
  src: url('../fonts/icomoon.eot?cl02ar');
  src: url('../fonts/icomoon.eot?cl02ar#iefix') format('embedded-opentype'), url('../fonts/icomoon.ttf?cl02ar') format('truetype'), url('../fonts/icomoon.woff?cl02ar') format('woff'), url('../fonts/icomoon.svg?cl02ar#icomoon') format('svg');
  font-weight: normal;
  font-style: normal;
}
[class^="icon-"],
[class*=" icon-"] {
  /* use !important to prevent issues with browser extensions that change fonts */
  font-family: 'icomoon' !important;
  speak: none;
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  /* Better Font Rendering =========== */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.icon-andr:before {
  content: "\e900";
}
.icon-arrow_b:before {
  content: "\e901";
}
.icon-fbeps:before {
  content: "\e902";
}
.icon-instagr:before {
  content: "\e903";
}
.icon-instagram_iconeps:before {
  content: "\e904";
}
.icon-map-markereps:before {
  content: "\e905";
}
.icon-mc:before {
  content: "\e906";
}
.icon-plus_b:before {
  content: "\e907";
}
.icon-plus:before {
  content: "\e908";
}
.icon-radio_icon:before {
  content: "\e909";
}
.icon-search_icon:before {
  content: "\e90a";
}
.icon-tw_iconeps:before {
  content: "\e90b";
}
.icon-yteps:before {
  content: "\e90c";
}
.icon-map-markereps2:before {
  content: "\e90d";
}
.icon-close_btn:before {
  content: "\e90f";
}
.icon-plus_b2:before {
  content: "\e910";
}
.icon-plus2:before {
  content: "\e911";
}
.icon-top_arrow:before {
  content: "\e912";
}
.icon-video_play:before {
  content: "\e913";
}
.icon-arrow_c:before {
  content: "\e914";
}
.icon-burger:before {
  content: "\e915";
}
.icon-minus:before {
  content: "\e90e";
}

提前谢谢你

EN

回答 1

Stack Overflow用户

发布于 2018-03-23 17:35:07

这真的应该是与css目录相对的吗?

路径不应该来自Apache基本路径吗?

代码语言:javascript
复制
src: url('assets/fonts/icomoon.eot?cl02ar');
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36361914

复制
相关文章

相似问题

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