【问题标题】:Rails 4: Bootstrap-sass and glyphiconsRails 4:Bootstrap-sass 和 glyphicons
【发布时间】:2014-03-25 19:25:36
【问题描述】:

使用 bootstrap-sass gem,但无法让字形图标显示在我的视图中。

宝石文件

gem 'bootstrap-sass', '2.3.2.0'
gem 'sass-rails', '>= 4.0.0'

CSS 文件

@import "bootstrap";

查看

<i class="glyphicon glyphicon-indent-right"></i>

【问题讨论】:

    标签: css ruby-on-rails ruby ruby-on-rails-4


    【解决方案1】:

    尝试使用

    CSS 文件

    @import "bootstrap-sprockets"; //this allow the gliphicon to work
    @import "bootstrap";
    

    这适用于我的 Gemfile

    gem 'bootstrap-sass', '3.2.0.1'
    gem 'sass-rails', '~> 4.0.0'
    

    【讨论】:

      【解决方案2】:

      使用 Bootstrap 2.3+ 你需要&lt;i class="icon-indent-right"&gt;&lt;/i&gt;

      检查official guide

      【讨论】:

      • 啊!我用谷歌搜索了引导 API,它与您链接的不同。 /手腕
      猜你喜欢
      • 2014-06-10
      • 2014-03-24
      • 2017-11-05
      • 2014-02-17
      • 1970-01-01
      • 1970-01-01
      • 2018-02-06
      • 2018-09-20
      • 1970-01-01
      相关资源
      最近更新 更多