FontAwesome: css content: "\f468"; doesnt work for some

226 views Asked by At

I am using the following method to display icons

&:before {
  font-family: Fontawesome;
  content: "\f468";
}

that works for about 30% of the icons. For example I tried the above, f468 and that did not work but when i did <i class="fas fa-boxes"></i> the icon displayed. Can you see the problem?

Im using https://use.fontawesome.com/releases/v5.5.0/css/all.css

1

There are 1 answers

3
Alexander Rice On

In the Font Awesome stylesheet, .fas{} has font-weight: 900; Many icons will show alternate versions or no icon at all if you do not include this.

&:before {
  font-family: Fontawesome;
  font-weight: 900;
  content: "\f468";
}

See if this code works for you.