Why font-awesome works on localhost but not on web ?

前端 未结 11 1826
感情败类
感情败类 2020-12-02 13:57

I\'m using font awesome in my project(mvc/asp.net). My problem is, I was debugging the project and check on localhost, there was no problem with fo

11条回答
  •  情书的邮戳
    2020-12-02 14:43

    I had the same problem. The solution:

    1. Open CSS file and delete the current font-face section and replace with these:

      @font-face {
      
          font-family: FontAwesome;
          src: url('/Content/fonts/fontawesome-webfont.eot'), /*for IE */
               url('/Content/fonts/fontawesomewebfont.svg'),
               url('/Content/fonts/fontawesome-webfont.ttf'); /* for CSS3 browsers */
          font-weight: normal;
          font-style: normal;
      }
      

      (change the font-face values as you want)

    2. Copy your ttf font file on your desktop then convert to eot

      http://www.kirsle.net/wizards/ttf2eot.cgi

    3. Convert ttf font file to svg

      http://www.freefontconverter.com/

    4. Convert ttf font file to woff (optional)

      http://ttf2woff.com/

    5. Drag and drop these all fonts (ttf, eot, svg, woff... ) to your file location when Visual Studio 2012 is open.

    6. Publish your project

提交回复
热议问题