Bootstrap 4 Glyphicons not showing on Angular 4 project

后端 未结 1 2075
一生所求
一生所求 2021-02-19 08:16

I\'m working on an Angular 4 Project using Bootstrap 4 with Sass, and I want to use the glyphicons but when I use the following code:

相关标签:
1条回答
  • 2021-02-19 08:37

    Bootstrap 4 dropped Glyphicons support. (see: https://getbootstrap.com/docs/4.0/migration/#components)

    This means that you'll need to use some other icon font, like Font Awesome.

    Quick start for Font Awesome

    1. Grab the script from the get started page
    2. Paste it in your <head>
    3. Start using! Search for the icons on FontAwesome.com
    4. Explore the docs to unleash the full potential of Font Awesome!

    Example:

    <!DOCTYPE html>
    <html>
      <head>
        <meta charset="utf-8">
        <title>Bootstrap + Font Awesome</title>
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css">
        <script defer src="https://use.fontawesome.com/releases/v5.0.8/js/all.js"></script>
      </head>
      <body>
        <div class="container">
          <!-- display 4 class makes the font size increase -->
          <h1 class="display-4"><i class="fab fa-stack-overflow"></i></h1>
          <p>That was easy! <i class="far fa-thumbs-up"></i></p>
          <button type="button" class="btn btn-primary">Works also with buttons! <i class="fas fa-link"></i></button>
        </div>
      </body>
    </html>

    Angular Font Awesome component

    The Font Awesome team is working on an Angular Font Awesome component. It is right now in pre-release, but you can find it here.

    0 讨论(0)
提交回复
热议问题