【问题标题】:Including bootstrap.min.css but glyphicon-star not working包括 bootstrap.min.css 但 glyphicon-star 不起作用
【发布时间】:2019-12-01 23:17:56
【问题描述】:

我从 bootswatch superhero 下载了 bootstrap.min.css,并在我的 index.html 头元素中执行此操作:

<link href="css/bootstrap.min.css" rel="stylesheet"/>

但是 glyphicon-star 不起作用。 因此,如果在我的指令 js 文件中我有:

template: '<span ng-repeat="star in vm.stars track by $index" class="glyphicon glyphicon-star">{{ star }}</span>',

什么都没有显示,而如果我做一些非常基本的事情,例如:

template: '<ul> <li ng-repeat="star in vm.stars track by $index" >{{ star }}</li></ul>'

我确实看到了列表项的项目符号。 vm.stars 是一个长度为 1 到 5 的数组。 为什么字形不显示?是否取决于 bootstrap.min.css 的版本?

【问题讨论】:

  • 您能否在您的应用程序中成功使用任何字形图标?
  • 可能不是,我缺少字体目录,所以它无法工作。看我的回答。

标签: css angularjs twitter-bootstrap


【解决方案1】:

解决方案是下载完整的引导程序并将从 bootswatch/superhero 下载的 bootstrap.min.css 替换为引导程序分发中的那个(我选择了 3.3.7)。 如果您打开 bootstrap.min.css 并搜索字形,则有匹配项,而 bootswatch/superhero 中的 bootstrap.min.css 中没有匹配项。 另一件事是将字体目录从引导 zip 复制到我的 AngularJS 应用程序的公共目录。 这解决了问题,现在我看到星星了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-21
    • 1970-01-01
    • 2019-01-31
    • 2011-08-10
    • 1970-01-01
    • 2019-08-03
    相关资源
    最近更新 更多