css - 从 icomoon 加载自定义字体

标签 css fonts icons

我正在使用 icomoon 创建自定义字体,但无法加载它。我已经使用 font book 检查了它,那里似乎没问题,但我无法加载它。

@font-face {
  font-family: 'icomoon';
  src: url('icomoon.eot');
  src: url('icomoon.eot#iefix') format('embedded-opentype'), url('dilatefonts/icomoon.ttf') format('truetype'), url('icomoon.woff') format('woff'), url('icomoon.svg') format('svg');
  font-weight: normal;
  font-style: normal;
}

enter image description here enter image description here

最佳答案

看起来你的 style.css 和字体在同一个文件夹中。 请尝试从字体路径中删除 dilatefonts。下面的示例-

  @font-face {
  font-family: 'icomoon';
  src: url('icomoon.eot');
  src: url('icomoon.eot#iefix') format('embedded-opentype'), url('dilatefonts/icomoon.ttf') format('truetype'), url('icomoon.woff') format('woff'), url('icomoon.svg') format('svg');
  font-weight: normal;
  font-style: normal;
}

关于css - 从 icomoon 加载自定义字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49045947/

相关文章:

html - Isotope + Wordpress 排版模式

CSS - 重命名字体

HTML - 将图标添加到浏览器选项卡

css - 在 Trac 中,是否可以将 "text-decoration: line-through"添加为自定义 __style__?

javascript - 如何允许缩放平板电脑,而不是移动设备

css - Lato 字体在 IE 和 Firefox 中丢失字母

css - Lato 中未显示箭头

javascript - Font Awesome 图标 innerHTML

Android Studio 谷歌图标导入

css - 如何在 Shiny 的应用程序中突出显示事件代码?