我正在嘗試使用bootstrap製作響應式導航欄。我想建立像http://wordpress.org/support/topic/want-to-move-search-option-from-header-to-navigation-bar。 。使用搜索按鈕製作響應式導航欄
但是,搜索按鈕不會向右移動,摺疊時,選項卡會分裂並移動到下面一行。在下載Wordpress按鈕的地方,我需要LogIn和SignUp按鈕。在摺疊品牌名稱時,搜索按鈕和用於打開菜單的欄應顯示在同一行中。
有人可以告訴如何去做嗎? See my code
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse-1">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Brand Name</a>
<form class="navbar-form navbar-right" style="float: right;" role="search">
<input type="text" class="form-control" placeholder="Search">
</form>
</div>
<div style="clear:both"></div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="navbar-collapse-1">
<ul class="nav navbar-nav navbar-left">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Highlights</a></li>
<li><a href="#">Test Yourself</a></li>
<li><a href="#">Interesting Questions</a></li>
<li><a href="#">Ask Queries</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="#">SignUp</a></li>
<li><a href="#">LogIn</a></li>
</ul>
</div>
</div>
</nav>
.navbar {
min-height: 120px;
}
.navbar .container {
padding-top: 20px;
padding-bottom: 20px;
}
.navbar-nav>li>a {
text-transform: uppercase;
font-family: "jokerman";
font-size: 16px;
}
@media (min-width: 768px) {
.navbar-nav {
margin: 0 auto;
display: table;
table-layout: fixed;
float: none;
}
}
是否有人在回答問題? – Aman 2014-09-10 15:09:05
你能展示它在全景中的樣子嗎 – Aman 2014-09-10 15:12:22