Awesome font icon 5 does not appear when called by css

Asked

Viewed 538 times

1

Personal am using fontawesome 5 and some icons do not appear when I call them by css follows my code and screen print of how the icone is being displayed. inserir a descrição da imagem aqui

HTML:

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.10/css/all.css" integrity="sha384-+d0P83n9kaQMCwj8F4RJB66tzIwOKmrdb46+porD/OvrJ+37WqIM7UoBtwHO6Nlg" crossorigin="anonymous">

<div class="col-lg-2 offset-lg-2 align-self-center">
    <p class="phone">Ligue para nós<br><span>11 97032-5884</span></p>
</div>

SCSS:

.phone{
    position: relative;
    color: $white;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    line-height: 17px;
    &:after{
      content: '\f232';
      font-family: "Font Awesome 5 Free";
      font-weight: normal;
      font-style: normal;
      position: absolute;
      left: -35px;
      top: 50%;
      font-size: 25px;
      margin-top: -7.5px;
      color: $white;
    }
    span{
      font-weight: 700;
      font-size: 20px;
    }
  }

1 answer

3

Your font-family is wrong! Vcused to Font Awesome 5 Free but it should be the Font Awesome 5 Brands

body {
  background-color: black;
  color: #fff;
}
.phone {
  position: relative;
  color: white;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  line-height: 17px;
  margin-left: 50px;
}

.phone:after {
  content: "\f232";
  font-family: "Font Awesome 5 Brands";
  font-weight: normal;
  font-style: normal;
  position: absolute;
  left: -35px;
  top: 50%;
  font-size: 25px;
  margin-top: -7.5px;
  color: white;
}

.phone span {
  font-weight: 700;
  font-size: 20px;
}
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.10/css/all.css">

<div class="col-lg-2 offset-lg-2 align-self-center">
  <p class="phone">Ligue para nós<br><span>11 97032-5884</span></p>
</div>

Note that in the documentation itself indicates the use of Brands Style

inserir a descrição da imagem aqui

  • Why do you have to use the Font Awesome 5 Brands?

  • @Victorcarnaval I edited the answer and includes an image that will enlighten you

  • It’s just that I’ve never used the awesome font this way... I’ve always used the classes in icon elements. Besides I couldn’t even find the documentation for version 5.0.10 that you found kkk

  • @Victorcarnaval here is the documentation of how to use the FA in pseudo-elements, in which case the indicated is to use the FA.css and not the . J if I’m not mistaken. Now look at these images, they would use the family-free, and you still have to see that one is for font-wigth 900 and the other for 400, depending on the icon http://prntscr.com/nm2aqv

  • Do you have any suggestions as to how I can learn to use these sources as you explained? I confess I didn’t quite understand it yet.

  • @Victorcarnaval look at this other image http://prntscr.com/nm2c90 I think it will be very clear for you to understand. On the website of Fontawesome itself has an instruction section on how to work with the source, including how to make Stack icon on each other and animates, change color etc. But on youtube I believe you should have videos on the subject

  • 1

    Thanks @hugocsl.

Show 2 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.