Picco
Picco

Reputation: 441

I wanna color a fa icon HTML

Suppose to have a fa icon:

//this code is not correct

  <i class="fa fa-trophy fa-3x" aria-hidden="true" style="background-color:#FFFF00;"></i>

My purpose is to color the trophy itself and not the backgroud outside the trophy. Now the trophy it appears me black how can I change trophy color in yellow?

Upvotes: 0

Views: 321

Answers (3)

Mamta Thakur
Mamta Thakur

Reputation: 147

fa icon is a font. Please use color property for this.

<i class="fa fa-trophy fa-3x" aria-hidden="true" style="color:#357ebd;"></i>

Upvotes: 0

cnrhgn
cnrhgn

Reputation: 703

Use the color property for fa icons.

<i class="fa fa-trophy fa-3x" aria-hidden="true" style="color:yellow;"></i>

Upvotes: 3

Anish Goyal
Anish Goyal

Reputation: 2859

Font awesome is a font - use the CSS color property to change the color, rather than background-color.

<i class="fa fa-trophy fa-3x" aria-hidden="true" style="color: #ffff00;"></i>

Upvotes: 7

Related Questions