Bootstrap 3两行Navbar折叠

时间:2014-09-22 19:05:54

标签: jquery html css twitter-bootstrap

我已经建立了两个相互贴在一起的导航栏,但每个导航栏都有单独的断点。我试图让顶部导航栏中心内容为小屏幕设备(平板电脑,768px及以上(默认为bootstrap 3)。

DEMO:http://www.bootply.com/uSgLupVpA8

我试过给它这些风格:

@media (min-width: @screen-sm-min) { 
.navbar-top{
display:inline;
text-align:center;
}
     }

但它仍显示在顶部的垂直列表中。

<!-- NAVBAR
================================================== -->
<nav class="navbar navbar-top navbar-inverse navbar-fixed-top" role="navigation">
  <div class="container-fluid">
    <div id="bs-example-navbar-collapse-2">
      <ul class="nav navbar-nav pull-right top-nav-link">
      <li> <i> xxx-xx </i> </li>
        <li><a data-toggle="modal" class="top-nav-link" data-target="#contactmodal" href="#">Contact</a></li>
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown">My Project <b class="caret"></b></a>
       <ul class="dropdown-menu pull-right" role="menu">
            <li><a href="#">My Cart <span class="badge pull-right">42</span></a></li>
          </ul>
        </li>
      </ul>
    </div>
  </div><!-- /.container-fluid -->
</nav> <!-- / top nav -->

<nav class="navbar navbar-default navbar-lower" data-spy="affix" data-offset-top="0" role="navigation"><!-- bottom Nav -->
  <div class="container-fluid">
  <div class="">
  <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>

      <a class="navbar-brand" rel="home" href="index.html" title="">
        <img src="http://placehold.it/150x50">
    </a>
        </div>
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
 <ul class="nav navbar-nav navbar-right">
<li class="dropdown menu-large">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown">Party<span class="caret"></span></a>

        </li>
<li class="dropdown menu-large">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown">Hashtag Guy<span class="caret"></span></a>

        </li>
        <li class="dropdown menu-large">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown">Blue Velvet<span class="caret"></span></a>

        </li>
          <li class="dropdown menu-large">
                  <a href="#" class="dropdown-toggle" data-toggle="dropdown"> Pudding <b class="caret"></b> </a>

            </li>

        <li class="dropdown menu-large">
                  <a href="#" class="dropdown-toggle" data-toggle="dropdown"> Projects <b class="caret"></b> </a>

            </li>       

           <li class="dropdown menu-large">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown"> Trades <b class="caret"></b></a>      
      </li>
          <form class="navbar-form navbar-left" style="display:inline;" role="search">
                <div class="input-group">
                    <input type="text" class="form-control" size="30" placeholder="Search" name="q">
                    <div class="input-group-btn">
                        <button class="btn btn-default" type="submit"><i class="glyphicon glyphicon-search"></i></button>
                    </div>
                </div>
            </form>
    </ul></div>



  </div>
</nav> <!-- /bottom nav-->

0 个答案:

没有答案