从icomoon加载自定义字体

问题描述 投票:0回答:1

我正在使用icomoon创建自定义字体,但我无法加载它。我已经使用字体书检查了它似乎没关系,但我在加载它时遇到问题。

@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

css fonts icons
1个回答
0
投票

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

  @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;
}
© www.soinside.com 2019 - 2024. All rights reserved.