Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Font awesome - change the inner "i" color in class="fa-info-circle"

Is it possible to change the inner "i" color within <i class="fa fa-info-circle"> ?

E.g. - in this fiddler make just the "i" with red color .

like image 683
URL87 Avatar asked Jun 28 '16 08:06

URL87


People also ask

How do I change the font color in awesome?

To change the color of the icons, simply add or change the “color” property in the CSS. So to change the color of the icons to red in the above example, add “color:red” to the . searchlinks a::after pseudo element.

How do I change the color of an icon?

Select the element you want to recolor by simply clicking on it. Tip: If you want to change the color of the whole icon, you can quickly select all elements with a “Command + A” (for Mac) or “Ctrl + A” (for Windows) keyboard shortcut. Step 3 — Click on the Color Picker tool in the left-hand panel.

What is the difference between FAS and fa in Font Awesome?

Instead of fa as a style preceding every icon style, you need to pick from fas for solid, far for regular, fal for light, or fab for brand. It looks like fas is the fallback, so you get solid if you leave your old fa references. For most icons, this change makes the icon heavier or lighter.


2 Answers

you should implement this like this:

html

<span class="fa-stack fa-2x">
  <i class="fa fa-circle fa-stack-2x icon-background2"></i>
  <i class="fa fa-info fa-stack-1x"></i> 
 </span>

css

.icon-background2 {
    color: #564363;
}

.fa-info {
  color:pink;
}

JSFiddle Example: https://jsfiddle.net/codejhonny/8feo4k4x/

like image 142
Jhonny Avatar answered Nov 30 '22 23:11

Jhonny


this icon is transparent so you could reach this but give it background color

.icon-background1 {
color: blue;
}
.fa-info-circle:before {
  content: "\f05a";
  background-color: red;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: inline-block;
  line-height: 50px;
}

check the fiddle

http://jsfiddle.net/Lgq1k4uc/7/

like image 21
Peter Wilson Avatar answered Dec 01 '22 01:12

Peter Wilson