【问题标题】:Glyphicon does not render to the template [duplicate]Glyphicon 不渲染到模板 [重复]
【发布时间】:2018-05-11 03:00:36
【问题描述】:

我已经在 VS Code 中安装了 bootstrap 并将其导入到styles.css

@import '~bootstrap/dist/css/bootstrap.css';

我还检查了package.json,可以在dependencies 下看到"bootstrap": "^4.1.1"。 但是当我尝试向模板渲染字形图标时,我什么也得不到。这是我模板中的代码:<span class="glyphicon glyphicon-star"></span>。 有谁知道为什么会发生这种情况?

【问题讨论】:

    标签: angular bootstrap-4


    【解决方案1】:

    他们在 Bootstrap 4 中删除了glyphicons。所以你不能使用它们。

    如果您需要图标,您必须手动将它们添加到您的项目中。 从https://glyphicons.com/ 下载Glyphicons,然后将其添加到index.html

    您可以在这里获取更多信息https://getbootstrap.com/docs/4.0/migration/#components

    希望对你有帮助...

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-03-25
      • 1970-01-01
      • 2019-11-19
      • 2015-10-29
      • 2010-11-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多