Font awesome is not showing icon

后端 未结 30 1261
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-30 06:03

I am using Font Awesome and do not wish to add CSS with HTTP. I downloaded Font Awesome and included it in my code, yet Font Awesome is showing a bordered square box instead

30条回答
  •  日久生厌
    2020-11-30 06:42

    In my case i made the following mistake in my css code.

    *{
        font-family: 'Open Sans', sans-serif !important;
    }
    

    This will override all font family rules for the entire page. My solution was to move the code to body like so.

    body{
        font-family: 'Open Sans', sans-serif;
    }
    

    NB: Whenever you use the !important flag in css, any other css rule declared of the same type on the same element will get overriden.

提交回复
热议问题