Font awesome not working in Firefox

前端 未结 8 1763
旧巷少年郎
旧巷少年郎 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 18:25

    Custom web fonts via CDN (or any cross-domain font request) doesn't work in Firefox or Internet Explorer (correctly so, by spec) though they do work (incorrectly so) in Webkit-based browsers.

    You can fix this by adding headers to your page.

    Apache

    
        Header set Access-Control-Allow-Origin "*"
    
    

    Nginx

    if ($filename ~* ^.*?\.(eot)|(ttf)|(woff)$){
        add_header Access-Control-Allow-Origin *;
    }
    

    Credit: http://davidwalsh.name/cdn-fonts

提交回复
热议问题