0

I have implemented font awesome icons in my ionic3 app, but it does not show up. My ionic project environment details,

cli packages: (C:\Users\acer\AppData\Roaming\npm\node_modules)

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

local packages:

    @ionic/app-scripts : 3.1.8
    Ionic Framework    : ionic-angular 3.9.2

System:

    Node : v8.4.0
    npm  : 5.8.0
    OS   : Windows 10

Misc:

    backend : pro

this is my intro.html file,

<ion-slides pager>
  <ion-slide style="background-color:yellow" >
      <i class="fas fa-utensils" style="font-size:120px;color:#ebebeb" aria-hidden="true"></i>
    </ion-slide>

  </ion-slides>

this is in my index.html file

 <!-- font-awesome -->
  <link href="/assets/css/font-awesome.min.css" rek="stylesheet" type="text/html">

I have already added following code, as many blog posts and SO answers suggested in my copy.config.js file

copyFontawesomeFonts: {
    src: ['{{ROOT}}/node_modules/font-awesome/fonts/**/*'],
    dest: '{{WWW}}/assets/fonts'
  },
  copyFontawesomeCss: {
    src: ['{{ROOT}}/node_modules/font-awesome/css/font-awesome.min.css'],
    dest: '{{WWW}}/assets/css'
  },
AVI
  • 5,516
  • 5
  • 29
  • 38
  • i checked it on the browser with ionic serve command – AVI Apr 05 '18 at 12:15
  • check it https://stackoverflow.com/questions/47617601/font-awesome-installation-in-ionic-3-project – Utpaul Apr 05 '18 at 16:36
  • @Utpaul i did that too mate, i saw it... later i gave up with font awesome icons and added ionic icons – AVI Apr 06 '18 at 01:03
  • try `assets/css/font-awesome.min.css`. Remove the `/` in the url – Duannx Apr 06 '18 at 01:53
  • To use font awesome in ionic already answered here, please go through with this [link](https://stackoverflow.com/questions/42747846/font-awesome-with-ionic2/47055657# ) – Suraj Bahadur Apr 06 '18 at 04:31

3 Answers3

1

You have syntax error in linking stylesheet

<link href="/assets/css/font-awesome.min.css" rek="stylesheet" type="text/html">

It should be

<link href="/assets/css/font-awesome.min.css" rel="stylesheet" type="text/css">
Deepak Kumar T P
  • 1,076
  • 10
  • 20
1

If you are linking a css-stylesheet its type should always be

type="text/css"

Change it from

<!-- font-awesome -->
<link href="/assets/css/font-awesome.min.css" rek="stylesheet" type="text/html">

to

<!-- font-awesome -->
<link href="/assets/css/font-awesome.min.css" rek="stylesheet" type="text/css">
Nasiruddin Saiyed
  • 1,438
  • 1
  • 13
  • 31
0

I have faced this issue earlier. Resolved it by loading css file from below url instead of loading from assets.