gpt4 book ai didi

css - 引导导航栏没有出现

转载 作者:行者123 更新时间:2023-11-28 03:32:47 25 4
gpt4 key购买 nike

我在使用 Bootstrap 时遇到了问题。以下是我在禁用 postgresql 和 turbolinks 的 Rails 中的应用程序页面。让我知道我做错了什么,我想不通。

<!DOCTYPE html>
<html>
<head>
<title>Website</title>
<%= csrf_meta_tags %>

<%= stylesheet_link_tag 'application', media: 'all' %>
<%= javascript_include_tag 'application' %>
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
integrity="sha384-
BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
crossorigin="anonymous">
</head>
<body>


<nav class="navbar navbar-toggleable-md navbar-light bg-faded">
<button class="navbar-toggler navbar-toggler-right" type="button" data-
toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-
expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="#">Navbar</a>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item active">
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Features</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Pricing</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
</div>
</nav>


<%= yield %>
</body>
</html>

The page looks as follows Browser console as follows, Using Bootstrap Gem and jquery Gem, let me know why I am recieving errors

最佳答案

您只导入了 bootstrap 的 CSS。你也需要 JS。

<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

最好使用 bootstrap gem,我经常使用 bootstrap-sass

关于css - 引导导航栏没有出现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44642284/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com