我正在使用bootstrap固定听到。我想添加一个退出按钮。当我添加时,它在第二行翘曲。是否有anaywa,我们可以将它移动到固定听力的同一行,但最右边的角落?
这是小提琴DEMO
<!-- Fixed navbar -->
<div class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li class="divider"></li>
<li class="dropdown-header">Nav header</li>
<li><a href="#">Separated link</a></li>
<li><a href="#">One more separated link</a></li>
</ul>
</li>
</ul>
</div><!--/.nav-collapse -->
<button type="button" class="btn btn-info col-md-1 col-md-offset-10">Log Out</button>
</div>
</div>
答案 0 :(得分:1)
删除col-md
个班级,然后添加navbar-btn
和navbar-right
。您还需要将按钮移动到nav-collapse
。
<button type="button" class="btn btn-info navbar-btn navbar-right">Log Out</button>