简体   繁体   中英

Error loading icons and fonts

anyone been through this problem. Simply does not load the fonts

  • Asp.net MVC4
  • IIS 7
  • Server amazon
  • Css in Materialize and Fontawesome

Image Remote 远端影像

Image Local 当地形象

Make sure you have the proper mime types set in IIS.

<system.webServer>
    <staticContent>
        <mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
        <mimeMap fileExtension=".ttf" mimeType="application/octet-stream" />
        <mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
        <mimeMap fileExtension=".woff" mimeType="application/x-woff" />
    </staticContent>
</system.webServer>

Source: http://codingstill.com/2013/01/set-mime-types-for-web-fonts-in-iis/

Alternatively, you can simply use a CDN, see: http://fortawesome.github.io/Font-Awesome/get-started/ . That effectively side-steps the issue as your server isn't serving the font files any more.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM