我的bootstrap导航栏中的切换用于工作但现在已经停止这样做,并且在我减小屏幕尺寸时不会显示菜单。我使用的代码是:
</head>
<body>
<div class="container-fluid" id="wrapper">
<nav class="navbar navbar-default">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#defaultNavbar2" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span><span class="icon-bar"></span></button>
<img src="images/logo.png" id="navbarlogo"></div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="defaultNavbar2">
<ul class="nav navbar-nav">
<li class="active"></li>
<li></li>
<li class="dropdown">
<ul class="dropdown-menu">
<li><a href="#Kontakt">Kontakt</a></li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="#Über">Über uns</a></li>
<li><a href="#Services">Services</a></li>
<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Kontakt<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#Adresse">Adresse</a></li>
<li><a href="impressum.html">Impressum</a></li>
</ul>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
有什么想法发生了什么?谢谢!
答案 0 :(得分:0)
我应该首先检查我的支持文件是否到位(css和js)。 navbar需要javascript才能正常工作。