Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Font-Awesome How to get fonts to scale?

I'm trying desperately to get my magnifying glass font to render it larger. The code below works fine in firefox but not in Chrome or IE9.

What am I missing?

.icon-larger
{
   font-size:50px;
}

<div class="search-icon"><i class="icon-search icon-larger"></i></div>

thanks!

like image 437
RSH Avatar asked Oct 29 '12 13:10

RSH


People also ask

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.

How do I make Font Awesome icons the same size?

Setting a Consistent Icon Width If you prefer to work with icons that have a consistent width, adding fa-fw will render each icon using the same width.

How do I change my Font Awesome icon Weight?

Change fa-weight icon size To increase fa-weight font awesome icon size, use the fa-lg (33% increase), fa-2x, fa-3x, fa-4x, or fa-5x classes along with icon class fa-weight. Increase in icon size will be relative to their parent container.

How do I change the alignment of Font Awesome icons?

If you want to make a text appear vertically aligned next to a Font Awesome icon, you can use the CSS vertical-align property set to “middle” and also, specify the line-height property. Change the size of the icon with the font-size property.


1 Answers

The Font Awesome icon is hooked to the :after pseudo element, so your CSS would need to be

.icon-larger:before 
{
  font-size: 50px;
}

I have created a reference page of all the CSS content values for Font Awesome, along with a CSS snippet which shows how to use the icons with any element: http://astronautweb.co/snippet/font-awesome/

like image 175
Astrotim Avatar answered Oct 25 '22 00:10

Astrotim