Icomoon.ttf没有加载

时间:2016-04-01 17:01:06

标签: css

我遇到了icomoon字体的问题。我根本无法加载它们。 但是,如果我点击,例如,这个网址:

localhost:8080 / assets / fonts / icomoon.ttf(我工作的项目)

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

我怎样才能让它发挥作用?我的相对路径似乎是正确的

这是我结构的一个例子:

 index---
        |
      assets
          |_css
          |     |---icomoon.css
          |
          |_fonts
               |icomoon files

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

@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";
}

提前谢谢

1 个答案:

答案 0 :(得分:0)

这真的应该来自​​css目录吗?

路径是否应该来自Apache基本路径?

src: url('assets/fonts/icomoon.eot?cl02ar');