css - 包括 bootstrap.min.css 但 glyphicon-star 不工作

标签 css angularjs twitter-bootstrap

我从 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的版本?

最佳答案

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

关于css - 包括 bootstrap.min.css 但 glyphicon-star 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57172131/

相关文章:

javascript - 服务器上更少的 HTTP 请求 - wordpress 站点

javascript - 如何以编程方式使用 AngularJS 提交表单

javascript - Angular js : disable tab key default behaviour

html - 将 div 拉伸(stretch)到浏览器的一侧

html - 背景位置不起作用

javascript - 显示 JS ToDo 列表中有多少已完成的任务 VS 有多少任务

html - 如何在 html/css 中使用字体

javascript - Angular 中的 HTML 片段在 View 中部分缺失

javascript - 在 React 组件中渲染时模态不显示

html - 我有一个超大屏幕内的子弹列表。我希望旁边的图像与元素符号的大小完全相同?