I want to change the transparent middle portion of fa-youtube-play
icon to red. I try this code:
.fa {
background-color: red;
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet"/>
<div>
<i class="fa fa-youtube-play fa-3x" aria-hidden="true"></i>
</div>
But sing this code will overlaps the icon. How do I make color to the inner transparent are only?
universal means no. I'm afraid you'll have to work with each icon individually.
.fa {
background-image: radial-gradient(at center, red 40%, transparent 40%);
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet"/>
<div>
<i class="fa fa-youtube-play fa-3x" aria-hidden="true"></i>
</div>
You can do that by using psuedo character i.e. :after
. This might help:
https://jsfiddle.net/kr8axdc3/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With