【问题标题】:Error on my Font-face - Give me 404 get to the side我的字体错误 - 给我 404 到一边
【发布时间】:2016-01-14 05:20:03
【问题描述】:

这就是我尝试在网站中制作令人敬畏的字体和简单的线条图标的方式,但它们继续给我的页面提供 404 错误。

我已经检查了 CSS 是否完全适合。并在页面上拉出来。

如果我把文件拿走所以没有错误但我再次添加它们,那么它们就会出现。

我已经尝试过它的Why is @font-face throwing a 404 error on woff files?

我查看了他们的 CSS,它们看起来像这样:

simple-line-icons.css

@font-face {
        font-family: 'Simple-Line-Icons';
        src:url('../fonts/Simple-Line-Icons.eot');
        src:url('../fonts/Simple-Line-Icons.eot?#iefix') format('embedded-opentype'),
        url('../fonts/Simple-Line-Icons.woff') format('woff'),
        url('../fonts/Simple-Line-Icons.ttf') format('truetype'),
        url('../fonts/Simple-Line-Icons.svg#Simple-Line-Icons') format('svg');
        font-weight: normal;
        font-style: normal;
    }

font-awesome.css

@font-face {
    font-family: 'FontAwesome';
    src: url('../fonts/fontawesome-webfont.eot?v=4.4.0');
    src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.4.0') format('embedded-opentype'), 
        url('../fonts/fontawesome-webfont.woff2?v=4.4.0') format('woff2'), 
        url('../fonts/fontawesome-webfont.woff?v=4.4.0') format('woff'), 
        url('../fonts/fontawesome-webfont.ttf?v=4.4.0') format('truetype'), 
        url('../fonts/fontawesome-webfont.svg?v=4.4.0#fontawesomeregular') format('svg');
    font-weight: normal;
    font-style: normal;
}

在这里我表明我只有正确放置的文件可能与我有 https 有关吗??

我已经买了它的design (Porto)

【问题讨论】:

  • "我已经用 CSS 检查了它是否适合所有的方式。然后把它拉到页面上。如果我把文件拿走,所以没有错误,但我再次添加它们,然后它们会出现。”你能解释一下这些句子的意思吗?
  • @TomGroot 如果我从该区域抓取 css 文件,那么似乎没有,但我删除了 CSS 文件。所以页面上不会出现错误。如果你不理解我那么远到后面去。

标签: css html http-status-code-404


【解决方案1】:

我也遇到过类似的问题,只是玩弄 URL 的顺序似乎可以解决问题。尝试一下你的第一个字体,如果可行,那么你就有了 Font Awesome 的基础。虽然我通常更喜欢在可能的情况下使用 CDN:

@font-face {
    font-family: 'Simple-Line-Icons';
    src: url('../fonts/Simple-Line-Icons.eot');
    src: url('../fonts/Simple-Line-Icons.eot?#iefix') format('embedded-opentype'),
         url('../fonts/Simple-Line-Icons.svg#Simple-Line-Icons') format('svg'),
         url('../fonts/Simple-Line-Icons.woff') format('woff'),
         url('../fonts/Simple-Line-Icons.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

【讨论】:

  • 我选择在 cdn 运行它们。也谢谢你告诉我没想到的cdn。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-12-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-07-20
  • 2021-10-08
  • 2021-09-09
相关资源
最近更新 更多