微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

css – Twitter bootstrap 3如何激活小型设备上的navbar-collapse

我正在使用bootstrap 3.0并在移动网站上工作。我试图找出如何显示和激活浏览平板电脑设备(小型/ SM设备)的导航栏切换,因为导航栏崩溃仅适用于超小型设备。使用引导2时没有问题

继承我的代码

<nav class="navbar navbar-inverse navbar-default-top" role="navigation" style="border:0px; background:#F26522;" align="center">

    <div class="col-lg-3  col-md-3 col-sm-12" style="background-color:#fff; height:192px;" align="center" > 

<div class="hidden-xs hidden-sm"></div><a  href="#"><img src="logo_png.png"   class="img-responsive" ></a></td>
   </div>


    <div class="col-lg-9 col-md-9 col-sm-12"">
      <div class="row">
        <div class="col-lg-11 col-md-11 col-sm-12">
          <button type="button" class="navbar-toggle pull-left hidden-md hidden-lg" data-toggle="collapse" data-target=".navbar-ex1-collapse"> <span class="sr-only ">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> 

          <div class="collapse navbar-collapse navbar-ex1-collapse">
            <ul class="nav navbar-nav navbar-left navr">
              <li class="navrli"><a href="#" id="nav-0">ABOUT</a> </li>

            </ul>
          </div>
        </div>
        <div class="col-lg-1 col-md-1 hidden-sm" align="right">
        </div>
      </div>
    </div>
    <!-- /.navbar-collapse --> 

  <!-- /.container --> 
</nav>

解决方法

认情况下,断点为@ screen-sm-min(即≥768px)。

View an Example

自定义导航栏断点

自定义导航栏断点,请更改较小的变量@ grid-float-breakpoint。

documentation

Overflowing content

Since Bootstrap doesn’t kNow how much space the content in your navbar needs,you might run into issues with content wrapping into a second row. To resolve this,you can:

c. Change the point at which your navbar switches between collapsed and horizontal mode. Customize the @grid-float-breakpoint variable or add your own media query.

您可以使用Bootstrap’s customization tool构建Bootstrap的修改版本。从here起,您可以将@ grid-float-breakpoint更改为由Bootstrap定义的另一个断点(即xs,sm,md,lg)或设置的量(即500px)。

完成后,导航到Download部分,然后单击Compile and Download

编辑

您的标记也按预期工作:http://jsbin.com/kuxah/1/edit?html,output

原文地址:https://www.jb51.cc/css/218233.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。