0
<nav class="navbar navbar-inverse navbar-fixed-top">
  <div class="container-fluid">
    <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 class="icon-bar" />
        <span class="icon-bar" />
      </button> <a class="navbar-brand" href="#">QA</a>
      <button type="button" class="btn btn-default navbar-btn">Sign in</button>
    </div>
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
        <li class="active">
          <a href="#">About<span class="sr-only">(current)</span></a>
        </li>
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Menu<span class="caret"/></a>
          <ul class="dropdown-menu">
            <li>
              <a href="#">Action</a>
            </li>
          </ul>
        </li>
      </ul>
    </div>
  </div>
</nav>

我的问题如下:在 Bootstrap 中是否可以将切换菜单内导航栏中的按钮作为链接而不是按钮?假设用户从桌面分辨率转到移动分辨率,他单击汉堡菜单并显示“登录”链接,但不再作为按钮

在此处输入图像描述

4

1 回答 1

0

hidden-xs类添加到导航栏中的按钮

<button type="button" class="btn btn-default navbar-btn hidden-xs">Sign in</button>

visible-xs在菜单的某处添加一个带有类的菜单项

<li class="visible-xs"><a href="#">Sign In</a></li>
于 2016-03-29T12:13:03.473 回答