答案 0 :(得分:2)
使用下面的bootstrap代码
<nav class = "navbar navbar-inverse navbar-static-top">
<div class = "container-fluid">
<!-- logo -->
<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 href="#" class ="navbar-brand">Application Name</a>
</div>
<!-- menu items -->
<div class="collapse navbar-collapse" id="myNavbar">
<ul class = "nav navbar-nav navbar-right">
<li><a href="#">Home</a></li>
<li><a href="#">About Us</a></li>
<li><a href="#">Contact Us</a></li>
</ul>
</div>
</div>
答案 1 :(得分:0)
将 navbar-inverse 类添加到导航栏以查看黑色导航栏。
以下是代码段
<nav class="navbar navbar-default navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">WebSiteName</a>
</div>
<ul class="nav navbar-nav navbar-right">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">About</a></li>
</ul>
</div>
</nav>