font awesome icon color code example

Example 1: css change font awesome icon color

<a href="/users/edit"><i class="fa fa-cog" style="color:black !important;"></i> Edit profile</a>

Example 2: css change font awesome icon color

.fa {
    color: red !important;
}

Example 3: font awesome color icons

<span style="font-size: 3em; color: Tomato;">
  <i class="fas fa-camera"></i>
</span>

<span style="font-size: 48px; color: Dodgerblue;">
  <i class="fas fa-camera"></i>
</span>

<span style="font-size: 3rem;">
  <span style="color: Mediumslateblue;">
  <i class="fas fa-camera"></i>
  </span>
</span>

Example 4: css change font awesome icon color

.<fa-icon-class> { color: red !important; }

Example 5: fab icon color

If you are using com.google.android.material.floatingactionbutton.FloatingActionButton, use app:tint:

app:tint="@android:color/white"

Example 6: how to change color of font awesome icons

<a href="/users/edit"><i class="icon-cog"></i> Edit profile</a>

Tags: