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