rwd
rwd

Reputation: 149

Disabling color on font awesome icon

I just added a href tag to my font awesome icon, which alters its color like so:

enter image description here

Is there a way to remove this link color?

<a href="https://www.w3schools.com"><i class="fa fa-facebook"></i></a>

Upvotes: 1

Views: 1156

Answers (3)

KyleMit
KyleMit

Reputation: 29917

You can change the color for all .fa icons inside anchor tags

a .fa {
    color: black;
}

Demo in Stack Snippets

a .fa {
  color: black;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet"/>

<a href="https://www.w3schools.com"><i class="fa fa-facebook"></i></a>

Upvotes: 1

Jesper
Jesper

Reputation: 3834

You can't "remove" the color, but you can change the color to something else.

Simply use CSS with a class

a.black{color: #000 !important}

Or on all atags

a{color: #000 !important}

Or directly on the tag

<a href="https://www.w3schools.com" style="color: #000 !important"><i class="fa fa-facebook"></i></a>

I'm adding the important tag, to ensure it stays black when being clicked or active.

Upvotes: 1

SoKeT
SoKeT

Reputation: 610

In your CSS:

.fa-facebook {
    color: black; /* or any other color */
}

Upvotes: 1

Related Questions