0

I am trying to integrate font-awesome into a web project but an identified little piece of code in my css makes the font-awesome icons appear as white squares. When I remove the little peace of CSS code it works but I cannot remove it due to the current web site layout. Is there a way to make the icons appear right anyway?

This is the code that blocks the icons that is needed for the layout:

*,*:before,*:after{
    box-sizing: border-box;
    position: relative;
    font-family : Arial;
    font-size   : 12px;
    font-weight : normal;
}

It doesn't matter if font-awesome css is included before or after my custom css code. The issue remains...

njlqay
  • 345
  • 2
  • 9
  • 21
  • 1
    Your font-family is being overwritten to Arial. Remove the font related parts from this selector and add it to a `body` selector. – timo Nov 06 '15 at 15:35
  • Please write it as answer. It solved my issue :-) – njlqay Nov 06 '15 at 15:40

3 Answers3

0

The problem is in *:before so you have to change that in you css. Take a look at this https://jsfiddle.net/ss95sfLz/

CSS

*,*:after{
  box-sizing: border-box;
  position: relative;
  font-family : Arial;
  font-size   : 12px;
  font-weight : normal;
}

This is problem because font-awesome icon use :before and this is the code

.fa-balance-scale::before {
   content: "";
}
Nenad Vracar
  • 118,580
  • 15
  • 151
  • 176
0

You are overriding all (*) of the fonts in the :before and :after pseudo selectors; which are used by font-awesome and many other libs. You should try to target only what needs to be changed by that code-snippet with a .class or #id.

juanmnl
  • 412
  • 3
  • 9
0

Your font-family is being overwritten to Arial. Remove the font related parts from this selector and add it to a body selector.

*,*:before,*:after{
    box-sizing: border-box;
    position: relative;
}

body {
    font-family : Arial;
    font-size   : 12px;
    font-weight : normal;
}
timo
  • 2,119
  • 1
  • 24
  • 40