我正在开发一个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
发布评论