0

I want to set background color for a fontawesome icon :

.vert {
      background: springgreen;
    }
...
return '<i class="fa fa-circle-thin vert"></i>';

At runtime I get this :

enter image description here

So how to fill just the interior of the circle ?

pheromix
  • 18,213
  • 29
  • 88
  • 158

4 Answers4

0

font-awesome V5

This example describes exactly the version you are using.

.vert {
color: springgreen;
}
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">

<span class="fa-stack">
  <i class="fas fa-circle vert fa-stack-2x"></i>
  <i class="far fa-circle fa-stack-2x"></i>
</span>

Here is codepen to describe your concern "Something wrong because interacting with bootstrap".

NickCoder
  • 1,504
  • 2
  • 23
  • 35
0

You can change the colour of the font-awesome icon by using color: springgreen;

In addition you will want to use a solid icon such as this https://fontawesome.com/icons/circle?style=solid

.vert {
      color: springgreen;
    }
...
return '<i class="fas fa-circle vert"></i>';
Mike Poole
  • 1,958
  • 5
  • 29
  • 41
  • @pheromix that is not a problem. You can use https://fontawesome.com/v4.7.0/icon/circle if you are still using version 4. Just remember to use `fa` instead of `fas` if you are using version 4. – Mike Poole Aug 16 '19 at 06:46
0

You can use stacked icons.

.vert {
  color: springgreen;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.8.1/css/all.css">


<span class="fa-stack">
  <i class="fas fa-circle vert fa-stack-2x"></i>
  <i class="far fa-circle  fa-stack-2x"></i>
</span>

Using Layers in Font Awesome 5

This feature requires that you use SVG + JS version of Font Awesome 5.

.vert {
  color: greenyellow;
}
<script src="https://use.fontawesome.com/releases/v5.8.1/js/all.js" data-search-pseudo-elements></script>

<div class="fa-4x">
  <span class="fa-layers fa-fw">
    <i class="fas fa-circle vert" ></i>
    <i class="far fa-circle"></i>
  </span>
</div>
Soothran
  • 1,233
  • 4
  • 14
0

If you need to fill the entire icon with spring green. Then use Border-radius. Example:-

.vert {
      color: springgreen;
    }

Or if you want to color only on the border. You can use the color property as depicted in the above answers.

Ankit
  • 64
  • 7