当我尝试从 Twitter Bootstrap 2.3.2 入门页面运行示例 Starter 模板并尝试将页面折叠到更小的尺寸时,导航栏项目不会像在演示中那样折叠到角落,而是保持下拉状态拉下。我正在使用 Rails
gem 'bootstrap-sass' and
gem 'sass-rails', '~> 3.2.3' [in assets]
我的 application.js 文件包括:
//= require jquery
//= require jquery_ujs
//= require bootstrap
//= require_tree .
我的 boostrap_and_overides.css.scss 文件包括:
@import "bootstrap";
body { padding-top: 60px; }
@import "bootstrap-responsive";
我喜欢响应式引导的想法,但不能让它在这里工作是主要代码:
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap 101 Template</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap -->
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
</head>
<body>
<h1>Hello, world!</h1
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="brand" href="#">Project name</a>
<div class="nav-collapse collapse">
<ul class="nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
</body>
</html>