Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FontAwesome doesn't display in Firefox

Tags:

Related question here.

Boris' answer to the above question seems to make sense, but I installed the Font Awesome files on my server and the problem remains:

enter image description here

I looked into the library and found that the font files are included in the install, so the argument about cross-server access to fonts doesn't seem valid. I don't mind using the BootstrapCDN, but then Boris' suggestion seems to apply, and I don't know how to send the right CORS headers. (I tried it, but it doesn't work either.) Any idea how I can fix this, either using the "Bootstrap CDN" or the "default CSS"? (see also these instructions.)


PS: IE10 shows the glyph correctly.

like image 736
stevenvh Avatar asked Nov 17 '13 15:11

stevenvh


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 Font Awesome icons are not showing?

Are you using Font Awesome Free or Pro? - Some icons are only available in Font Awesome Pro. Double-check that the icon you want is in the version of Font Awesome you're referencing and using. Also, make sure you are using and referencing the right style prefix and supporting files to use Pro icons.

How do I show font awesome icons?

You can place Font Awesome icons just about anywhere using the CSS Prefix fa and the icon's name. Font Awesome is designed to be used with inline elements (we like the <i> tag for brevity, but using a <span> is more semantically correct). icon If you change the font-size of the icon's container, the icon gets bigger.


2 Answers

Did you try Bootstrap CDN?

Just include <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"> in your <head> section. Font files will be loaded automatically from CDN, too.

Checked this on Firefox and it works perfectly.

@Boris says:

Firefox only allows cross-domain linking of fonts if the server the font is on sends the right CORS headers.

So it's clear that it's CDNs duty to set the right headers, not yours. And them seem to do that correctly, because Firefox doesn't complain.

If you host fonts on your own server, keep in mind that cross-domain rule may still apply, e.g. font files places under domain.com may be unaccessible from www.domain.com, if www.domain.com doesn't send the right headers.

Read this answer for tips about bypassing cross-sub-domain restrictions - this might help in your case.

like image 112
Michał Rybak Avatar answered Oct 13 '22 21:10

Michał Rybak


Put in a custom CSS the following (for me it solved the problem):

@font-face {   font-family:'FontAwesome';   src:url('./fontawesome-webfont.eot');   src:url('./fontawesome-webfont.eot?#iefix') format('embedded-opentype'),   url('./fontawesome-webfont.woff') format('woff'),   url('./fontawesome-webfont.ttf') format('truetype'),   url('./fontawesome-webfont.svg#FontAwesome') format('svg');   font-weight:normal;   font-style:normal }  [class^="icon-"]:before, [class*=" icon-"]:before {   font-family:FontAwesome;   font-weight:normal;   font-style:normal;   display:inline-block;   text-decoration:inherit } 
like image 27
user12541389 Avatar answered Oct 13 '22 21:10

user12541389