开始学习Bootstrap并遇到问题...我的导航栏切换因某些原因无效...
这是我的代码:
<nav>
<div class="container">
<div class="row">
<div class="navbar-header">
<a href="#" class="navbar-brand logo">
<img src="img/logo.png" alt="Logo">
</a>
<button class="navbar-toggle collapsed menu_btn" data-toogle="collapse" data-target="#top_menu">
Menu
</button>
</div>
<div class="collapse navbar-collapse navbar-right" id="top_menu">
<ul class="menu">
<li><a href="#">Features</a></li>
<li><a href="#">Works</a></li>
<li><a href="#">our team</a></li>
<li><a href="#">testimoials</a></li>
<li><a href="#">download</a></li>
</ul>
</div>
</div>
<div class="top_line"></div>
</div>
</nav>
图书馆是正确的。
谢谢!
答案 0 :(得分:2)
你有一个错字..
data-toogle="collapse"
应该是
data-toggle="collapse"
答案 1 :(得分:0)
<div class="container">
<div class="row">
<nav class="navbar navbar-default">
<div class="navbar-header">
<a href="#" class="navbar-brand logo">
<img src="img/logo.png" alt="Logo" />
</a>
<button class="navbar-toggle collapsed menu_btn" data-toggle="collapse" data-target="#top_menu">Menu</button>
</div>
<div class="collapse navbar-collapse navbar-right" id="top_menu">
<ul class="nav navbar-nav" class="menu">
<li><a href="#">Features</a></li>
<li><a href="#">Works</a></li>
<li><a href="#">our team</a></li>
<li><a href="#">testimoials</a></li>
<li><a href="#">download</a></li>
</ul>
</div>
</nav>
</div>
<div class="top_line"></div>
</div>