【问题标题】:Rails4 - Bootstrap 3 my glyphicons render as empty boxesRails4 - Bootstrap 3 我的 glyphicons 呈现为空框
【发布时间】:2014-02-25 08:44:31
【问题描述】:

我在我的网站上丢失了我的 Glyphicons,它们正在被空盒子取代。我已经看到了 Bootstrap 3 和 Glyphicons 的很多问题,但是到目前为止我发现的修复都没有帮助我。我最近升级到 gem 'bootstrap-sass', '~> 3.1.0.0'。我认为我的语法是正确的。是否有可能需要更改的 Glyphicons 路径?

这是我放置 Glyphicons 的三个地方:

<input type="text" class="form-control" placeholder="Search" name="search" id="search">
  <div class="input-group-btn">
    <button class="btn btn-default" type="submit"><i class="glyphicon glyphicon-search"></i></button>
  </div>


<%= link_to pin, method: :delete, data: { confirm: 'Are you sure?' } do %>
  <span class="glyphicon glyphicon-trash"></span>
          Delete
<% end %>


<%= link_to root_path do %>
    <span class="glyphicon glyphicon-home"></span>
<% end %>

【问题讨论】:

    标签: ruby-on-rails-4 twitter-bootstrap-3 glyphicons


    【解决方案1】:

    我不确定这是否是最好的做法,但我将其添加到我的 CSS 中:

    @import url("//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css")
    

    他们回来了!

    【讨论】:

      【解决方案2】:

      您也可以将其添加到您的 scss 文件中。

      @import "bootstrap-sprockets";
      

      【讨论】:

      • 一路上我都试过了,但是没有用。希望它会帮助别人!谢谢
      猜你喜欢
      • 2014-01-19
      • 2013-08-15
      • 2015-04-23
      • 2016-04-03
      • 1970-01-01
      • 2016-03-07
      • 2014-08-17
      • 2014-03-29
      相关资源
      最近更新 更多