Reputation: 1
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
Upvotes: 0
Views: 408
Reputation: 3932
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>
Upvotes: 1
Reputation: 15921
Assuming localhost
If you are running the site from local server i.e., localhost
, it wont get loaded in forefox
go to -> about:config
-> security.fileuri.strict_origin_policy
Set it to false
and you would be able to see fonts then!!
Also,giving absolute path
url's are far better and suggested option than having a relative
path!
Upvotes: 0