【问题标题】:Why won't my Bootstrap 3 button icons display?为什么我的 Bootstrap 3 按钮图标不显示?
【发布时间】:2013-09-20 00:09:20
【问题描述】:

基本上,我试图显示大约 5 个按钮,我需要其中 4 个有图标。

我在我的文档的head 中包含了以下链接

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

不过,按钮只是以正确的样式显示,旁边没有图标。

这是我的按钮的代码

<a href="#" class="btn btn-info btn-large"><i class="icon-white icon-home"></i> Home</a>
<a href="#" class="btn btn-info btn-large"><i class="icon-white icon-info-sign"></i> About</a>
<a href="#" class="btn btn-info btn-large">FAQ <i class="icon-white icon-question-sign"></i></a>
<a href="#" class="btn btn-info btn-large">Learn <i class="icon-white icon-check"></i></a>

在我的引导文件夹中,我还有 3 个其他文件夹,分别名为 cssfontsjs。里面都是直接从Bootstrap下载的。

我也尝试过包含一些 javascript 文件和其他 css 文件,但没有任何变化。

【问题讨论】:

  • 您使用的是哪个引导程序版本?
  • @devo - 最新的 3.0

标签: css twitter-bootstrap twitter-bootstrap-3


【解决方案1】:

Bootstrap 3 已将图标更改为使用 Glyphicons Halflings 集的字体格式。

您现在需要使用glyphicon 的基类,后跟您要使用的特定字形图标的类(完整列表请参见链接):

<span class="glyphicon glyphicon-cog"></span>

【讨论】:

    【解决方案2】:

    你应该使用 span 而不是 i,

    <span class="glyphicon glyphicon-home"></span>
    

    查看http://getbootstrap.com/components/#glyphicons

    【讨论】:

    • 标签不是问题。实际上,您以主观方式给出了答案,但没有解释它:)
    猜你喜欢
    • 1970-01-01
    • 2012-02-27
    • 2017-06-06
    • 1970-01-01
    • 2021-01-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多