-1

Currently I am working on a sample solution using icons from Font Awesome's CDN.

For some reason my icons are displaying with a white background. I noticed this when applying the shadow effect from Bootstrap in my html.

enter image description here

Really what I would like to see here is simply the fingerprint icon foreground and a transparent background.

HTML

<div class="row text-center">
    <div class="col ">
        <div>
              <span>
                  <i class="fas fa-fingerprint fa-5x shadow "></i>
              </span>
        </div>
    </div>
</div>
Matthew
  • 3,976
  • 15
  • 66
  • 130

4 Answers4

4

We have two kinds of shadows in CSS:

box-shadows

Shadows that work in block level (like the one you have used here)

text-shadow

Shadows that work in text level

it seems that bootstrap's shadow class only works in box level and you have to remove it and use custom CSS like this:

span i {
  text-shadow: 2px 2px #000000;
}
Mahdi Aryayi
  • 1,090
  • 7
  • 13
2

'box-shadow' will put the shadow on the 'i' surrounding the icon not the icon itself.

As Font Awesome is a SVG font you will need to be using 'text-shadow'.

.shadow {
  text-shadow: 2px 2px #20202088;
}

.fa-fingerprint {
  color: #25b8f0;
}
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/all.css" integrity="sha384-hWVjflwFxL6sNzntih27bfxkr27PmbbK/iSvJ+a4+0owXq79v+lsFkW54bOGbiDQ" crossorigin="anonymous">

<div class="row text-center">
    <div class="col ">
        <div>
              <span>
                  <i class="fas fa-fingerprint fa-5x shadow "></i>
              </span>
        </div>
    </div>
</div>
crffty
  • 424
  • 1
  • 5
  • 16
0

Check this out.

Font Awesome is actually a font. So, we need to give the text-shadow. :)

.fas { 
  color: orange; 
  text-shadow: 1px 1px #333 
}
<link href="https://use.fontawesome.com/releases/v5.2.0/css/all.css" rel="stylesheet"/>
<div class="row text-center">
  <div class="col ">
    <div>
      <span><i class="fas fa-fingerprint fa-5x shadow" ></i></span>
    </div>
  </div>
</div>
Eugine Joseph
  • 1,552
  • 3
  • 18
  • 40
-1

I ended up creating a text-shadow class in css and used that in my HTML to generate the the shadow effect.

HTML UPDATE

<div class="row text-center">
    <div class="col ">
        <div>
              <span>
                  <i class="fas fa-fingerprint fa-5x text-shadow "></i>
              </span>
        </div>
    </div>
</div>

CSS Update

.text-shadow {
    text-shadow: 2px 2px #20202088;
}
Matthew
  • 3,976
  • 15
  • 66
  • 130