Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 无法加载字体文件,404错误_Css_Svg_Http Status Code 404_Font Face_Webfonts - Fatal编程技术网

Css 无法加载字体文件,404错误

Css 无法加载字体文件,404错误,css,svg,http-status-code-404,font-face,webfonts,Css,Svg,Http Status Code 404,Font Face,Webfonts,我在一个项目中使用了两个字体图标。字体和自定义SVG字体。所有字体文件都在同一文件夹中。以下是文件结构: -assets -css -font-awesome.min.css -themefy.css -fonts -font-awesome.eot -font-awesome.svg -font-awesome.ttf -font-awesome.woff -font

我在一个项目中使用了两个字体图标。字体和自定义SVG字体。所有字体文件都在同一文件夹中。以下是文件结构:

-assets
    -css
        -font-awesome.min.css
        -themefy.css
    -fonts
        -font-awesome.eot
        -font-awesome.svg
        -font-awesome.ttf
        -font-awesome.woff
        -font-awesome.woff2
        -font-awesomed41d.eot
        -themify.eot
        -themify.svg
        -themify.ttf
        -themify.woff
        -themifyd41d.eot
这两种字体在localhost中都可以正常工作,但部署后,themifyfont无法工作。它返回chrome控制台中未找到的
404
。我花了2/3天的时间对它进行了大量的研究,仍然无法找出问题所在。这是我的主题化@font-face:

主题化.css

@font-face {
    font-family: 'themify';
    src:url('../fonts/themify.eot?-fvbane');
    src:url('../fonts/themifyd41d.eot?#iefix-fvbane') format('embedded-opentype'),
        url('../fonts/themify.woff?-fvbane') format('woff'),
        url('../fonts/themify.ttf?-fvbane') format('truetype'),
        url('../fonts/themify.svg?-fvbane#themify') format('svg');
    font-weight: normal;
    font-style: normal;
}
如果您想观看直播:


请从字体CSS中删除后缀(?-fvbane),这可能是404造成的。

在下面的Web.config文件中添加代码

  <system.webServer>
    <staticContent>
      <remove fileExtension=".woff" />
      <mimeMap fileExtension=".woff" mimeType="font/woff" />
    </staticContent>    
  </system.webServer>


是啊!成功了!!我以前做过,但那一次旧的
css
在我的浏览器缓存中,所以结果是一样的。现在它运行良好,非常感谢。有人知道“-fvbane”是做什么用的吗?