Font awesome not working in Firefox

前端 未结 8 1713
旧巷少年郎
旧巷少年郎 2020-12-02 17:38

I\'m using bootstrap and I added font awesome through Less, overriding the Glyphicons. The icons display OK in chrome but in Firefox i just see boxes.

This is how my

相关标签:
8条回答
  • 2020-12-02 17:58

    I was having issue with the if statement because I didn't have a $filename variable.

    But I did have similar results using:

    location ~ /\.(eot|otf|ttf|woff)$ {
            add_header Access-Control-Allow-Origin *;
        }
    
    0 讨论(0)
  • 2020-12-02 18:01

    If you want a quick and easy way to make Font-awesome work, try using CDNJS. It's free and powered by CloudFlare. CORS is supported out of the box.

    Try something like this:

    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.2.1/css/font-awesome.min.css" media="all" rel="stylesheet" type="text/css">
    
    0 讨论(0)
  • 2020-12-02 18:01

    If you are hosting the font on S3, you have to enable CORS on the bucket. Through AWS Management Console, edit the properties for the bucket and under Permissions click on "Add CORS Configuration". In my case, if I left the default config, it still didn't work, so I changed it to:

    <CORSConfiguration>
        <CORSRule>
            <AllowedOrigin>*</AllowedOrigin>
            <AllowedMethod>GET</AllowedMethod>
        </CORSRule>
    </CORSConfiguration>
    
    0 讨论(0)
  • If you're using wordpress and you think you've tried everything, look and see if you ever installed a Font Awesome plugin. Disable the plugin and refresh in Firefox.

    This was the solution for me - the plugin's older version of font-awesome was overriding the files I was trying to update myself manually.

    0 讨论(0)
  • 2020-12-02 18:06

    If you're like me, modifying a web.config file is something you're not allowed to touch.

    Try storing all the font files (.eot, .ttf, etc) into their own local folder, and link to them locally instead of the FontAwesome CDN. Cleared it up in IE and FF for me every time.

    @font-face{ font-family:'FontAwesome'; src:url('../_fonts/fontawesome-webfont.eot'); }
    
    0 讨论(0)
  • 2020-12-02 18:10

    In fonts folder please upload the following files

    FontAwesome.otf
    fontawesome-webfont.eot
    fontawesome-webfont.svg
    fontawesome-webfont.ttf
    fontawesome-webfont.woff
    ------------------ Important glyphicons files----------------
    glyphicons-halflings-regular.eot
    glyphicons-halflings-regular.svg
    glyphicons-halflings-regular.ttf
    glyphicons-halflings-regular.woff

    Please upload the following files and after that you link your font-awesome.min.css in your header file.

    Here is the following link with proper files: http://goo.gl/WICQAf

    0 讨论(0)
提交回复
热议问题