Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Font awesome not working in Firefox

Tags:

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 directory looks like

-- Project   -- js   -- css   -- less   -- font-awesome     -- css     -- font     -- less 

All I've modified in the Project > less > boostrap.less file has been:

@import "sprites.less";  //for this line  @import "../font-awesome/less/font-awesome.less"; 

As I said in Chrome works fine but for some reason Firefox shows only boxes.

like image 563
filistea Avatar asked May 31 '13 22:05

filistea


People also ask

Does Font Awesome work in Firefox?

If you are using font awesome then you might have noticed that icons fonts don't appear in Firefox and it happens when you try to use CDN services.

Why is Font Awesome not working?

Make sure you're using the latest and greatest by updating your CDN code reference, updating your Font Awesome package via npm, or downloading a fresh copy of Font Awesome. You can check with version an icon was added to on its detail page (e.g. question-circle was added in Verion 1 but last updated in 5.0.

Why are my Font Awesome icons not showing?

If you installed the Free Font Awesome version but try adding Pro icons to your web pages, they won't show. The solution to this is either you use the alternative free icons or upgrade to a Pro subscription/license.

How do I use Font Awesome 4.7 offline?

Go to font awesome official website and download free zip file, extract it and link this to your page, done..! To be able to use font awesome offline you would have to manually download the icons to your local computer. You should be able to find the required files from the font awesome website.


2 Answers

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

<FilesMatch ".(eot|ttf|otf|woff)">     Header set Access-Control-Allow-Origin "*" </FilesMatch> 

Nginx

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

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

like image 145
Dustin Brownell Avatar answered Sep 28 '22 09:09

Dustin Brownell


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"> 
like image 26
premjg Avatar answered Sep 28 '22 09:09

premjg