Search code examples
htmlcsscolorsiconsfont-awesome

Can I change the color of Font Awesome's cog icon?


I have to wrap my icon within an <a> tag for some reason.
Is there any possible way to change the color of a font-awesome icon to black?
or is it impossible as long as it wrapped within an <a> tag? Font awesome is supposed to be font not image, right?

enter image description here

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

Solution

  • This worked for me:

    .icon-cog {
      color: black;
    }
    

    For versions of Font Awesome above 4.7.0, it looks this:

    .fa-cog {
      color: black;
    }