根据宽度隐藏bootstrap导航栏

时间:2015-10-31 19:26:18

标签: twitter-bootstrap-3

我有以下引导代码:

  <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#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 class="collapse navbar-collapse" id="collapse-1">
  <ul class="nav navbar-nav">
    <li class="active"><a href="#">Link 1<span class="sr-only">(current)</span></a></li>
    <li><a href="#">Link 2</a></li>                                                                          
  </ul>

当屏幕宽度较小时,将链接1和链接2折叠为折叠菜单,否则它只显示在导航栏中。当屏幕宽度很大时,有没有办法在导航栏中隐藏链接1和链接2,只显示它们作为折叠菜单选项?

0 个答案:

没有答案