我正在使用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;
}
看起来你的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;
}