Can a transparent background of icons be transparent?

I use the awesome font with the “x” icon - but it has a white background - can fonts-awesome backgrounds be transparent?

The reason is because I want to display it on top of the image. Which option do I need to do?

Current code:

 <i class="fa fa-times fa- m-n"></i>
+4
source share
1 answer

Yes, the awesome font uses ::beforepsuedo for its icons, so just do, for example:

Demo script

i::before{
    background:transparent;
}

However, you will most likely want to use more specificity than just i, for example:

i[class*=fa-times]::before{
   background:transparent;
}
+7
source

Source: https://habr.com/ru/post/1541385/


All Articles