@font-face 文件无法离线加载
我在使用 @font-face
和我机器上的字体时遇到问题。我的文件还没有在服务器上。我正在尝试离线预览它们,但它们未加载。
这是 css 文件中的代码:
@font-face{
font-family:"chunk";
src: url('file:///C:/...Fonts/Chunkfive.otf');
}
div{
font-family:"chunk";
}
有人遇到过类似的问题吗?
I'm having trouble using @font-face
with fonts located on my machine. My files aren't on a server yet. I'm trying to preview them offline, but they aren't loading.
Here is the code from the css file:
@font-face{
font-family:"chunk";
src: url('file:///C:/...Fonts/Chunkfive.otf');
}
div{
font-family:"chunk";
}
Has anyone had similar problems?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将它们包含在您的站点文件夹中,并像处理图像一样引用它们。
Include them in your site folder, and reference them as you do with images.
@pvenkat;如果您的
字体文件夹& css 在同一文件夹中,然后只需在您的 url 路径中写入此
Fonts/Chunk Five.otf
即可如果您的 css 文件夹是stylesheet 文件夹
中的其他文件夹,则在您的路径中写入../Fonts/Chunk Five.otf
可能适合您。@pvenkat; if your
font folder & css in same folder
then just write thisFonts/Chunkfive.otf
in your url path & if your css folder some other folder like instylesheet folder
then write../Fonts/Chunkfive.otf
in your path may be that's work for you.