Questions tagged [font-awesome]

Font Awesome is an iconic standalone vector font, initially developed for use with the Twitter Bootstrap front-end framework.

Font Awesome is an iconic font purely built using scalable vector graphics, so it provides clear, smooth and scalable icons for use in different browsers and on different devices.

Font Awesome is currently on version 5.15.

You can check the new icons added here

Previous Versions:

  • v4.x.x
  • v3.x.x (These docs are for v3.2.1, which is no longer officially supported)

Version 4.1 was the first Font Awesome version that drops support of IE7 entirely, so you should not upgrade to it or any later version if your application must support IE7 browser.

Current version provides 7,865 font-icons

You can subset font-awesome using either icnfnt or fontello to create specific icon sets rather than downloading the entire family of icons.

It is free for commercial use and licensed under the SIL Open Font License 1.1.

CDN

Font awesome is available as a hosted file on content delivery networks, eg BootstrapCDN and Cloudflare CDN.

Stack Overflow Snippet Quick Start v5.15.2

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.2/css/all.min.css" />

Syntax, v5.x.x (documentation):

fa[x] fa-[name]

Where:

  • [x] is a prefix used for style group types (ex: fab- where b stands for brand)
  • [name] is the name of the icon (icon list).

For example:

<i class="fas fa-camera"></i> <!-- this icon's 1) style prefix == fas and 2) icon name == camera -->
<i class="fas fa-camera"></i> <!-- using an <i> element to reference the icon -->
<span class="fas fa-camera"></span> <!-- using a <span> element to reference the icon -->

Stack Overflow Snippet Quick Start v4.7.0

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css">

Syntax, v4.x.x (documentation):

fa fa-[name]-[shape]-[o]-[direction]

Where:

  • [name] is the name of the icon (icon list).
  • [shape] is the optional shape of the icon's background: either circle or square.
  • [o] is the optional outlined version of the icon.
  • [direction] is the direction in which certain icons point (arrows, etc.).

For example:

<i class="fa fa-cogs"></i>
<i class="fa fa-bookmark-o"></i>
<i class="fa fa-facebook-square"></i>
<i class="fa fa-arrow-left"></i>

As Font Awesome icons are font-based we can then apply our own styling on top:

i.fa {
    color: purple;
    font-size: 64px;
    padding: 5px 10px;
}

CSS-applied Example

5577 questions
146
votes
7 answers

Using Font Awesome icon for bullet points, with a single list item element

We'd like to be able to use a Font Awesome ( http://fortawesome.github.com/Font-Awesome/ ) icon as a bullet point for unordered lists in a CMS. The text editor on the CMS only outputs raw HTML so additional elements/ classes cannot be added. This…
BaronGrivet
  • 4,364
  • 5
  • 37
  • 52
142
votes
6 answers

Use Font Awesome Icon As Favicon

Is it possible to use a Font Awesome icon as a favicon icon? You know, the little icon that appears along-side a website title in the browser tab?
Connor Black
  • 6,921
  • 12
  • 39
  • 70
137
votes
19 answers

How to include a Font Awesome icon in React's render()

Whenever I try to use a Font Awesome icon in React's render(), it isn't displayed on the resulting web page although it works in normal HTML. render: function() { return
no spinner but why
; } Here…
user3127060
  • 1,493
  • 2
  • 10
  • 10
130
votes
18 answers

Use Font Awesome Icon in Placeholder

Is it possible to use Font Awesome Icon in a Placeholder? I read that HTML isn't allowed in a placeholder. Is there a workaround? placeholder=""
L84
  • 45,514
  • 58
  • 177
  • 257
124
votes
11 answers

How to use font-awesome icons from node-modules

I have installed font-awesome 4.0.3 icons using npm install. If I need to use it from node-modules how should I use it in html file? If I need to edit the less file do I need to edit it in node-modules?
Govan
  • 7,751
  • 5
  • 26
  • 42
120
votes
34 answers

Font awesome is not showing icon

I am using Font Awesome and do not wish to add CSS with HTTP. I downloaded Font Awesome and included it in my code, yet Font Awesome is showing a bordered square box instead of an icon. Here is my code:
Ganesh H
  • 1,649
  • 3
  • 14
  • 20
112
votes
8 answers

Extracting SVG from Font Awesome

I want to get the SVG path data from Font Awesome glyphs so that I can use them straight up as SVG in my HTML. I thought it would be as easy as copy-pasting the path data from fontawesome-webfont.svg, but when I use it in my HTML the symbols are all…
Yarin
  • 173,523
  • 149
  • 402
  • 512
111
votes
10 answers

How to vertically align text with icon font?

I have a very basic HTML which mix plain text and icon fonts. The problem is that icons are not exactly rendered at the same height than the text:
104
votes
6 answers

Statically rotate font-awesome icons

I'd like to statically rotate my font-awesome icons by 45 degrees. It says on the site that: To arbitrarily rotate and flip icons, use the fa-rotate-* and fa-flip-* classes. However, doing
user592419
  • 5,103
  • 9
  • 42
  • 67
101
votes
4 answers

How do I make sure every glyph has the same width?

I've noticed that even at the same font size, there is not a standard width. How can I use these in front of a list of items so the words don't appear jagged? Screenshot of issue: This is the code:
95
votes
5 answers

Alt or title attribute for i tag

I use font-awesome and display their fonts like that: This will display a nice little lock symbol. For the user to know what exactly that means, I tried adding attributes such as title and alt, but to no avail. Is there…
Dennis Hackethal
  • 13,662
  • 12
  • 66
  • 115
94
votes
8 answers

How do I add a Font Awesome icon to input field?

How do I use the search icon included in Font Awesome for input? I have a search feature on my site (based on PHPmotion), that I want to use for the search. Here's the code:
93
votes
6 answers

Change font-weight of FontAwesome icons?

I'd like to make one of the FontAwesome icons a bit less heavy - it's much heavier than the font I am using. This how it looks presently: : Ugly, right? So I've tried resetting the font-weight as follows: .tag .icon-remove { font-weight:…
Richard
  • 62,943
  • 126
  • 334
  • 542
91
votes
9 answers

Optimize Font Awesome for only used classes

I am using Font Awesome Sass file https://github.com/FortAwesome/Font-Awesome/blob/master/sass/font-awesome.sass to make it _font-awesome.sass so I can @import in my Sass project. I am also using http://middlemanapp.com/ to convert Sass to Css.…
HP.
  • 19,226
  • 53
  • 154
  • 253
90
votes
9 answers

How do I load font-awesome using SCSS (SASS) in Webpack using relative paths?

I have font-awesome in my node_modules folder so I try to import it in my main .scss file like so: @import "../../node_modules/font-awesome/scss/font-awesome.scss"; But Webpack bundling compilation fails, telling me Error: Cannot resolve 'file' or…
Richard
  • 14,798
  • 21
  • 70
  • 103