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
2
votes
5 answers

How to use FontAwesome inside single html file?

I am building a windows app that has integrated browser. I am using this browser for the app's GUI. It works by pushing a string of code to the browser which would normally be your index.html contents. JS UI lib code and CSS code are all in the…
2
votes
0 answers

Using Rollup + PostCSS + Font Awesome

What would be the appropriate method to allow me to import Font Awesome (from npm font-awesome) to allow me to be able to include it and use it from my CSS. Linking to it directly from node_modules wouldn't work, since that wouldn't be available at…
samanime
  • 25,408
  • 15
  • 90
  • 139
2
votes
0 answers

FontAwesome icon with fabricJS

I am trying to use FontAwesome icon on FabricJs text object but can't get it to render the icon. It works with regular canvas on the same page. My code: const text = new fabric.IText('\uf0c2',{ left: this.centerX, //Take the block's…
Ziv
  • 538
  • 1
  • 4
  • 7
2
votes
1 answer

check if glyph is rendered "correctly"

I'm writing a tcl/tk application, where i would like to use font-awesome icons. In principal, this works nicely: just display some string/label with the correct unicode char, and if the proper fonts are installed, it will render) Now, on my dev…
umläute
  • 28,885
  • 9
  • 68
  • 122
2
votes
2 answers

How can I import external CSS files into my Ember app?

I am trying to import Font Awesome and Google Fonts into my Ember app but they aren't working. None of the styles are being applied. I am using ember-cli-sass. Am I not able to import a stylesheet from a CDN? Does it not compile .css files? I tried…
Michael Lynch
  • 2,682
  • 3
  • 31
  • 59
2
votes
2 answers

Using Font Awesome CDN

I am wondering why you get a unique embed code every time for using Font Awesome CDN. Is there any downside to using the same embed code multiple times?
Agomez
  • 23
  • 2
2
votes
1 answer

Fill a FontAwesome icon

I'm trying to fill the times-circle icon from FontAwesome which is transparent inside. So I tried to apply a background-color: white to this element but since the element is squared I have…
boubasse
  • 41
  • 2
  • 6
2
votes
1 answer

workaround for setting part of attribute (for font-awesome icon) in vue 2 template without interpolation?

I'm trying to create a component using vue.js, where the component contains a font-awesome icon, which is supplied in template. For example, I'd like to be able to use and have the font-awesome phone…
Paul Gowder
  • 2,409
  • 1
  • 21
  • 36
2
votes
1 answer

How to include FontAwesome Icon in a React.js project

I'm trying to display a glyphicon using the following package, https://github.com/danawoodman/react-fontawesome. I read through the documentation on the Github page but am having trouble connecting the dots. I understand that I need to import the…
ipatch
  • 3,933
  • 8
  • 60
  • 99
2
votes
1 answer

Exporting HTML icons as PDF

I have a webpage with material-icon and font-awesome icons. However, when I try to export the HTML website as PDF (using web tools, plugins or Adobe Acrobat DC for Mac), the icons are not shown (it just shows a the name of the icon). I am including…
Eu Román
  • 165
  • 1
  • 1
  • 11
2
votes
2 answers

check if font awesome exists before enqueueing to wordpress

I'm trying to enqueue font awesome only if haven't been enqueued before. This is my code: function stylesheet_installed($array_css) { global $wp_styles; foreach( $wp_styles->queue as $style ) { foreach ($array_css as $css) …
JCdotNET
  • 339
  • 2
  • 12
2
votes
2 answers

Font awesome - change icon inside color on hover

I'm trying to change the inside color of an icon when hovering it, I've tried this css code: .fa-star-o:hover { color: black; }
Rafael Duarte
  • 569
  • 6
  • 21
2
votes
1 answer

List all available font awesome icons for Leaflet map in Shiny, R

I'm makin a Shiny App where I want the user to be able choose the Font Awesome icon that goes into an Awesome Marker. Here's a simple app that lets the user choose the marker colour, the icon colour and the icon…
Jiddu Alexander
  • 141
  • 2
  • 7
2
votes
2 answers

Slide and Toggle classes of font awesome jQuery

I am in a process of learning jQuery. There are many things I still don't understand. Here, I am trying to slide toggle the classes of font awesome. Not sure how can I achieve that. This is what I have so far. $(function() { …
Hafiz Temuri
  • 3,882
  • 6
  • 41
  • 66
2
votes
1 answer

Add font awesome icon before heading?

I am trying to design my own homepage and using this Read-Only template. I want to customize my headings a little bit so it would have an icon before. Here is my code .icon { text-decoration: none; text-size: 1em; display:…
rll
  • 79
  • 1
  • 4