【发布时间】:2019-01-06 23:21:15
【问题描述】:
我无法让我的@font-face 工作。当我检查元素时它会注册,但它只会触发备份衬线字体。我就是这样设置的:
@font-face {
font-family: 'Wremena';
src: url('./fonts/Wremena Light.woff') format('woff'),
url('./fonts/Wremena Light.woff2') format('woff2'),
url('./fonts/Wremena Light.ttf') format('truetype'),
url('./fonts/Wremena Light.otf') format('opentype');
font-weight: normal;
font-style: normal;
}
以及如何使用:
.name {
font-family: 'Wremena', serif;
font-weight: lighter;
font-size: 2em;
line-height: 1em;
}
网站链接在这里: www.koreatownmovie.com
【问题讨论】:
-
Don't use all those formats。首先使用 woff/woff2,然后检查浏览器控制台是否有错误。
-
控制台显示 woff 和 woff2 字体的 404 错误。你确定你使用的是正确的路径吗?它说字体应该在:koreatownmovie.com/css/fonts/Wremena%20Light.woff。也许他们在koreatownmovie.com/fonts...而不是?
标签: css fonts font-face typography