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 :
So how to fill just the interior of the circle ?
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 :
So how to fill just the interior of the circle ?
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".
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>';
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>
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.