css - rails 5-bootstrap-sass 导航栏响应不工作

标签 css sass navbar ruby-on-rails-5 bootstrap-sass

为什么 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.html.erb

head 中添加这两行来解决它
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

关于css - rails 5-bootstrap-sass 导航栏响应不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38735311/

相关文章:

sass - SCSS 符号运算符

css - Phonegap,480x720、480x800 和 480x854 的 css 样式问题

html - 在 float 子 <div> 上使用高度 100%

html - 如何在保持响应的同时截断文本

html - 尝试为 div 添加定位

css - 如何修复导航栏悬停问题 CSS

javascript - 将数据传送到 Excel 工作表时,我需要去除类 "touch"

css - CSS 自定义属性是否可以包含多个要引用的值?

jquery - 在汉堡菜单中隐藏列表项

css - Twitter Bootstrap - 全宽导航栏