为什么我的 ttf 字体出现 404 错误?
在我的网站上,我使用 SASS
我有以下代码:
--- 编辑 ---
@font-face {
font-family: 'BauhausBold';
src: url('/Type/bauhaus_bold.eot');
src: url('/Type/bauhaus_bold.eot?#iefix') format('embedded-opentype'),
url('/Type/bauhaus_bold.woff') format('woff'),
url('/Type/bauhaus_bold.ttf') format('truetype'),
url('/Type/bauhaus_bold.svg#BauhausBold') format('svg');
font-weight: normal;
font-style: normal;
}
要使用此字体:
font-family: quote('bind'), arial;
但我们总是在我的网站上收到 404 错误。查看图片:
完整图片:https://i.sstatic.net/jAhWY.png
您可以访问该网站:bindsolution.com(如果他们愿意)。
感谢大家的帮助!
On my site, I use SASS
I have the following code:
--- Edit ---
@font-face {
font-family: 'BauhausBold';
src: url('/Type/bauhaus_bold.eot');
src: url('/Type/bauhaus_bold.eot?#iefix') format('embedded-opentype'),
url('/Type/bauhaus_bold.woff') format('woff'),
url('/Type/bauhaus_bold.ttf') format('truetype'),
url('/Type/bauhaus_bold.svg#BauhausBold') format('svg');
font-weight: normal;
font-style: normal;
}
To use this font:
font-family: quote('bind'), arial;
But we always get the error 404 on my site. See the image:
Full image: https://i.sstatic.net/jAhWY.png
You can access the site: bindsolution.com if they wish.
Thank you all for your help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我刚刚遇到了完全相同的问题,但无法解决。我以为这是由于相对路径造成的,但事实并非如此。事实证明,我在 CSS 中的字体名称是大写的,而文件名称实际上是小写的。以前的服务器不关心,但这个关心。仅此而已。
I've just had exactly same problem and I couldn't solve it. I thought it was due to relative path but it wasn't. It turned out that I had my fonts names in CSS in uppercase while the files' names were actualy lower case. Previous server didn't care but this one does. That is all.