为什么我的 ttf 字体出现 404 错误?

发布于 2024-12-22 07:20:55 字数 998 浏览 4 评论 0原文

在我的网站上,我使用 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 错误。查看图片:

Error 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:

Error 404

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

宁愿没拥抱 2024-12-29 07:20:55

我刚刚遇到了完全相同的问题,但无法解决。我以为这是由于相对路径造成的,但事实并非如此。事实证明,我在 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文