【发布时间】:2016-08-03 05:44:04
【问题描述】:
为什么 navbar responsiveness 在 Rails 5 上不起作用。我正在使用bootstrap-sass gem。我已经在互联网上搜索并尝试了可能的解决方案,但我没有运气。
这是我的/app/assets/stylesheets/application.css.scss
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
* files in this directory. Styles in this file should be added after the last require_* statement.
* It is generally better to create a new file per style scope.
*
*
*
*/
@import "bootstrap-sprockets";
@import "bootstrap";
非常感谢任何帮助!
谢谢,
【问题讨论】:
-
您是否在您的
application.js too?中添加了//= require bootstrap-sprockets -
不,我添加了
//= require bootstrap -
你只需要
//= require bootstrap-sprocketsinapplication.js -
我已经将它从
require bootstrap更改为require bootstrap-sprockets仍然没有运气。
标签: css sass navbar ruby-on-rails-5 bootstrap-sass