[英]Why this CSS font-face code does not load the font?
我在CSS中编写了以下代码来加载字体。 路径是双重检查,它们很好,但我不知道它为什么不加载它们。 它工作到几天前。 现在,它不起作用。 这是书面代码:
@font-face {
font-family: 'yekan';
src: url('fonts/WebYekan.eot?#') format('eot'),
url('fonts/WebYekan.ttf') format('eot'),
url('fonts/WebYekan.woff') format('truetype');
}
解:
您将错误的格式引用到错误的字体文件。 修正如下:
@font-face {
font-family: 'yekan';
src: url('fonts/WebYekan.eot?#') format('eot'),
url('fonts/WebYekan.ttf') format('truetype'),
url('fonts/WebYekan.woff') format('woff');
}
这可能有用
@font-face {
font-family: 'yekan';
src: url('fonts/WebYekan.eot?#') format('eot'),
url('fonts/WebYekan.ttf') format('truetype'),
url('fonts/WebYekan.woff') format('woff');
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.