我真的无法找到导致我的导航栏崩溃的问题。请问您能告诉我这个问题的错误。我在导航中添加了jQuery和glyphicons。这是导致这个问题的原因吗。
<!--Navigation Start-->
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button class="navbar-toggle" data-toggle="collapse" data-target="#navigation">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="home.html">Senid Computer</a>
</div>
<div class="collapse navbar-collapse" id="navigation">
<ul class="nav navbar-nav navbar-center">
<li class="active">
<a href="home.html">
<center><i class="fa fa-home medium"></i>
</center>Home</a>
</li>
<li class="dropdown" id="li1">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<center><i class="fa fa-laptop medium"></i>
</center>Laptops <span class="caret"></span>
</a>
<ul class="dropdown-menu" id="id1-dd">
<li>
<a href="laptops/laptop_apple.html">Apple</a>
</li>
<li>
<a href="laptops/laptop_hp.html">Hewlett Packard</a>
</li>
<li>
<a href="laptops/laptop_dell.html">Dell</a>
</li>
<li>
<a href="laptops/laptop_asus.html">Asus</a>
</li>
</ul>
</li>
<li>
<a href="desktop.html">
<center><i class="fa fa-desktop medium text-inverse"></i>
</center>Desktops</a>
</li>
<li>
<a href="accessories.html" class="nav-ele-color">
<center><i class="fa fa-gamepad medium nav-ele-color"></i>
</center>Accessories</a>
</li>
<li class="">
<a href="contact_us.html">
<center><i class="fa fa-phone medium text-inverse"></i>
</center>Contact Us</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="#" class="dropdown-toggle" data-toggle="dropdown" id="login_main"><span id="login_main_p">Login <span class="glyphicon glyphicon-log-in"></span></span></a>
<div class="dropdown-menu" id="login_div">
<form id="formLogin" class="form container-fluid">
<div class="form-group">
<label for="uname">User Name:</label>
<input type="text" class="form-control" id="user_name" placeholder="User Name" value="">
</div>
<div class="form-group">
<label for="password">Password:</label>
<input type="password" class="form-control" id="password_login" placeholder="Password" value="">
</div>
<a href="javascript:login()" class="btn btn-success"><span class="glyphicon glyphicon-user"></span> Login</a>
</form>
</div>
</li>
</ul>
</div>
</div>
</div>
</nav>
答案 0 :(得分:0)
试试这个:
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Site Name</a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Page 1 <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">Page 1-1</a></li>
<li><a href="#">Page 1-2</a></li>
<li><a href="#">Page 1-3</a></li>
</ul>
</li>
<li><a href="#">Page 2</a></li>
<li><a href="#">Page 3</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="#"><i class="fa fa-medium"></i> Sign Up</a></li>
<li><a href="#"><span class="glyphicon glyphicon-log-in"></span> Login</a></li>
</ul>
</div>
</div>
</nav>