My Bootstrap nav
只有两个元素。如何最小化页面时如何禁用Bootstrap的折叠功能?即使我最小化页面,“登录”按钮也很容易适合。
/* Navigation */
.navbar-brand img {
width:30%;
height:100%;
}
.navbar-default {
padding-top:10px;
padding-bottom:10px;
}
.navbar {
background: #23272D !important;
}
#logo {
width: 83.33px;
height: 27.68px;
}
#login_button {
position: relative !important;
top: 7px !important;
}
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet"/>
<!-- Navigation -->
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<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="navbar-brand">
<a href='#'> <img src='http://logos-download.com/wp-content/uploads/2016/06/Udemy_logo.png' class='img-responsive' id='logo'> </a>
</div>
</div>
<div class="collapse navbar-collapse navbar-right" id="bs-example-navbar-collapse-1">
<button type="button" class="btn btn-danger" id='login_button'>Login</button>
</div>
</nav>
<!-- End of Navigation -->
答案 0 :(得分:2)
使用以下代码更新导航部分
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-brand">
<a href="#"> <img src="http://logos-download.com/wp-content/uploads/2016/06/Udemy_logo.png" class="img-responsive" id="logo"> </a>
</div>
<div class="pull-right">
<button type="button" class="btn btn-danger" id="login_button">Login</button>
</div>
</div>
</nav>
试试这个。