<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中使用导航栏中的按钮 切换菜单作为链接而不是按钮? 让我们说用户从桌面到移动分辨率,他点击汉堡包菜单,显示“登录”链接,但不再显示按钮
答案 0 :(得分: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>