需要帮助像这样制作导航栏

时间:2017-07-28 19:50:38

标签: twitter-bootstrap-3

我需要将我的vavbar显示为navbar

我在Bootstrap文档中找不到任何选项。 有没有办法做到这一点?

2 个答案:

答案 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>

演示:https://codepen.io/karthikdivi/pen/qXOwoL