自定义字体不导入
字体CSS导入似乎都没有用... 我以为也许是因为我没有使用XAMPP,但这似乎并不重要……我不明白。
<style>
@font-face{
font-family: "ogrejuice";
src: url('ogrejuice.ttf'),
url('ogrejuice.eot'); /* IE */
}
</style>
尝试2
<style>
@font-face{
<!-- font-family: "ogrejuice"; -->
src: url('ogrejuice.woff2'),
src: local('ogrejuice.woff2'),
<!-- url('ogrejuice.eot'); /* IE */ -->
}
</style>
尝试3
<style>
@font-face{
<!-- font-family: "ogrejuice"; -->
src: url('ogrejuice.woff2'),
src: local('ogrejuice.woff2'),
<!-- url('ogrejuice.eot'); /* IE */ -->
}
@font-face {
font-family: "ogrejuice";
font-style: normal;
font-weight: 400;
font-display: block;
src: url("../ogrejuice.eot");
src: url("../ogrejuice.eot?#iefix") format("ie9-skip-eot"),
url("../ogrejuice.woff2") format("woff2"),
url("..ogrejuice.woff") format("woff");
}
</style>
尝试4
<style>
@font-face {
font-family: myFirstFont;
src: url(ogrejuice.woff);
}
</style>
none of the font CSS import seems to work...
I thought maybe it was because I wasn't using xampp, but it doesn't seem to matter... still doesn't work, I don't understand.
<style>
@font-face{
font-family: "ogrejuice";
src: url('ogrejuice.ttf'),
url('ogrejuice.eot'); /* IE */
}
</style>
attempt 2
<style>
@font-face{
<!-- font-family: "ogrejuice"; -->
src: url('ogrejuice.woff2'),
src: local('ogrejuice.woff2'),
<!-- url('ogrejuice.eot'); /* IE */ -->
}
</style>
attempt 3
<style>
@font-face{
<!-- font-family: "ogrejuice"; -->
src: url('ogrejuice.woff2'),
src: local('ogrejuice.woff2'),
<!-- url('ogrejuice.eot'); /* IE */ -->
}
@font-face {
font-family: "ogrejuice";
font-style: normal;
font-weight: 400;
font-display: block;
src: url("../ogrejuice.eot");
src: url("../ogrejuice.eot?#iefix") format("ie9-skip-eot"),
url("../ogrejuice.woff2") format("woff2"),
url("..ogrejuice.woff") format("woff");
}
</style>
attempt 4
<style>
@font-face {
font-family: myFirstFont;
src: url(ogrejuice.woff);
}
</style>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,所以。第一次使用自定义字体用户...当您设置字体时。这并不意味着您的页面会使用它...考虑上述
代码对我来说很好。不知何故,设置字体脸实际上没有做任何事情,除了使字体可用吗?绝对不会想到这一点。除了特定的情况之外,我通常不会在项目的CSS中使用 @符号,因此直到现在我还没有对其进行任何关注。
ok so. For all first time custom font users out there... when you set the font.. That doesn't mean your page will use it... Consider the fallowing
The above code works fine for me. Somehow, setting the font-face doesn't actually do anything except make the font available, I guess? Definitely would not have thought of that. I don't normally use the @ symbol in the CSS of my projects except for specific cases like break points, so I haven't paid any attention to it until now.