【发布时间】:2017-04-28 11:29:09
【问题描述】:
我正在像这样使用@font-face:
@font-face {
font-family: DINPro;
font-weight: bold;
src: url(../res/fonts/DINPro-Bold.otf) format("opentype");
}
@font-face {
font-family: DINPro;
src: url(../res/fonts/DINPro-Regular.otf) format("opentype");
}
@font-face {
font-family: DFLiHei;
src: url(../res/fonts/DFLiHei-Regular.ttf) format('truetype');
}
h1{
font-family: DFLiHei !important;
}
但不工作。 我的文件夹结构很可能:
/index.html
/css/style.css
/res/fonts/DINPro-Bold.otf
/res/fonts/DINPro-Regular.otf
/res/fonts/DFLiHei-Regular.ttf
因此,我认为错误的目录不是我的问题。 此外,不仅在特殊浏览器中失败,而且在 chrome 和移动设备中也失败。 有什么想法吗?
【问题讨论】:
-
尝试删除第二个字体系列,或者先删除两个。仅供测试