将Navbar放在像Clientexec这样的Navbar上

时间:2016-10-18 20:10:18

标签: html css twitter-bootstrap

我想知道如何创建一个像clientexec-navbar这样的导航栏(带有导航栏的页面的演示:http://demo.clientexec.com/),在这里预览: clientexec navbar preview

我从那开始,但现在我不知道该继续谁: enter image description here

如果有人能告诉我该怎么做,那将是非常酷的。我上传了我当前的项目:http://www.file-upload.net/download-12026579/index_build_3.rar.html

谢谢你, 问候, CabCon!

2 个答案:

答案 0 :(得分:0)

我创建了这个例子,希望能以任何方式帮助你。

Sample

<header class="header">
  <h1 class="brand-sample">Brading</h1>
</header>
<section class="content">
  <div class="container-fluid">
    <div class="row">
      <div class="col-xs-12 col-md-12 col-lg-12">
        <nav class="navbar navbar-default">
          <!-- 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="#bs-example-navbar-collapse-1" 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>
          </div>

          <!-- Collect the nav links, forms, and other content for toggling -->
          <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
              <li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li>
              <li><a href="#">Link</a></li>
              <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
                <ul class="dropdown-menu">
                  <li><a href="#">Action</a></li>
                  <li><a href="#">Another action</a></li>
                  <li><a href="#">Something else here</a></li>
                  <li role="separator" class="divider"></li>
                  <li><a href="#">Separated link</a></li>
                  <li role="separator" class="divider"></li>
                  <li><a href="#">One more separated link</a></li>
                </ul>
              </li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
              <li><a href="#">Link</a></li>
              <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
                <ul class="dropdown-menu">
                  <li><a href="#">Action</a></li>
                  <li><a href="#">Another action</a></li>
                  <li><a href="#">Something else here</a></li>
                  <li role="separator" class="divider"></li>
                  <li><a href="#">Separated link</a></li>
                </ul>
              </li>
            </ul>
          </div>
          <!-- /.navbar-collapse -->
        </nav>
      </div>
    </div>
  </div>
  <!-- /.container -->
</section>


.header {
  width: 100%;
  height: 90px;
  padding: 10px 15px;
  background-color: #368db7;
}

.content {
  margin-top: -30px;
}

.brand-sample {
  margin: 0;
  color: white;
}

答案 1 :(得分:0)

我昨天在一个项目上实际做了同样的事情。您可以使用两个导航栏,fixed-top或第二个导航栏static-top,并添加适当的margin-top

这是一个简单的工作示例:

<nav id="top-nav" class="navbar navbar-default navbar-fixed-top">
            <div class="container-fluid">
                <div class="navbar-header">
                    <a id="brand" class="navbar-brand" href="#">...</a>
                </div>
                <ul class="nav navbar-nav navbar-right">
                    <li>
                        <span class="glyphicon glyphicon-earphone"></span>
                    </li>
                </ul>
            </div>
        </nav>




        <nav id="bottom-nav" class="navbar navbar-default navbar-fixed-top">
            <div class="container-fluid">
                <!-- 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="#bs-example-navbar-collapse-1" 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>
                </div>

                <!-- Collect the nav links, forms, and other content for toggling -->
                <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                    <ul id="center-nav" class="nav navbar-nav">
                        <li><a href="#">Home</a></li>
                        <li><a href="#">About</a></li>
                        <li><a href="#">Projects</a></li>
                        <li><a href="#">Contact</a></li>
                    </ul>
                </div>
            </div>
        </nav>