FireFox无法加载404 Not Found字体(FireFox Can not load fonts 404 Not Found)

编程入门 行业动态 更新时间:2024-10-26 08:33:21
FireFox无法加载404 Not Found字体(FireFox Can not load fonts 404 Not Found)

我正在开发一个asp.net mvc web应用程序,我在CSS文件中有以下内容: -

@font-face { font-family: 'Ubuntu'; font-style: normal; font-weight: 400; src: url(_tMhxyW6i8lbI7YsUdFlGA.eot); src: local('Ubuntu'), url(_tMhxyW6i8lbI7YsUdFlGA.eot) format('embedded-opentype'), url(_xyN3apAT_yRRDeqB3sPRg.woff) format('woff'); }

我已经在同一文件夹(Conten / CSS)中添加了字体和CSS文件,但是当我在firefox上检查F12时,它提到它无法获取.woff文件,尽管文件在CSS文件夹中?

任何人都可以建议导致此问题的原因吗? 谢谢

I am working on an asp.net mvc web application, and i have the following inside my CSS file:-

@font-face { font-family: 'Ubuntu'; font-style: normal; font-weight: 400; src: url(_tMhxyW6i8lbI7YsUdFlGA.eot); src: local('Ubuntu'), url(_tMhxyW6i8lbI7YsUdFlGA.eot) format('embedded-opentype'), url(_xyN3apAT_yRRDeqB3sPRg.woff) format('woff'); }

i have added the fonts and CSS files inside the same folder (Conten/CSS), but when i check the F12 on firefox it mentioned that it can not get the .woff files, although the files are inside the CSS folder ?

Can anyone advice what is causing this issue ? Thanks

最满意答案

我和MVC有同样的问题。

以下是与您的问题相关的答案: https : //stackoverflow.com/a/7374640/1838483

我通过IIS管理器.woff application/x-woff添加MIME类型声明解决了这个问题。 您也可以在配置文件中添加它,如下所示:

<system.webServer> <staticContent> <mimeMap fileExtension=".woff" mimeType="application/x-font-woff" /> <mimeMap fileExtension=".svg" mimeType="image/svg+xml" /> </staticContent> </system.webServer>

I had the same issue with MVC.

Here is an answer relating to your question: https://stackoverflow.com/a/7374640/1838483

I solved this issue by adding a MIME Type declaration via IIS Manager .woff application/x-woff. You can also add this in your config file like so:

<system.webServer> <staticContent> <mimeMap fileExtension=".woff" mimeType="application/x-font-woff" /> <mimeMap fileExtension=".svg" mimeType="image/svg+xml" /> </staticContent> </system.webServer>

更多推荐

CSS,woff,文件,format,电脑培训,计算机培训,IT培训"/> <meta name="descriptio

本文发布于:2023-08-04 14:04:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1416123.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:加载   字体   FireFox   fonts   load

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!