Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Font awesome icon showing as square in chrome?

I am trying to use a font-awsome icon within a button. The icon works fine in firefox but when I use it in chrome it appears as a square. I have looked around and the only thing that I found was that the paths to the fonts may not be right however I have since tried the cdn version here and it is still working in firefox but not in chrome.

Also I have tried the same stylesheets in a static html file on my computer it is working fine.

Here is an example of the html being used:

<a id="btnLogin" href="url.com" class="btn btn-primary btn-large disabled">
    <i class="icon-refresh icon-white"></i> 
    Sign in using Facebook
</a>

And also the web app is built with rails and is using bootstrap for the templates.

Any ideas as to what could be causing this?

like image 528
startupsmith Avatar asked Apr 04 '13 08:04

startupsmith


People also ask

Why Font Awesome icon is showing as a square?

Quoted from their website: The fa prefix has been deprecated in version 5. The new default is the fas solid style and the fab style for brands. This is why my fonts were showing blank squares.

How do I scale Font Awesome icons?

To increase icon sizes relative to their container, use the fa-lg (33% increase), fa-2x , fa-3x , fa-4x , or fa-5x classes. If your icons are getting chopped off on top and bottom, make sure you have sufficient line-height.


1 Answers

I had the same issue. But I fixed it easly.

In Font Awesome fonts files must be placed in "fonts" directory instead of "font" directory in previous versions.

like image 139
Michal Avatar answered Oct 04 '22 14:10

Michal