I am trying to make a responsive navigation bar using bootstrap. I want to build like http://wordpress.org/support/topic/want-to-move-search-option-from-header-to-navigation-bar . .
But the search button don't go to the right and when collapsed the tabs split and move to the line below. At the place of Download Wordpress button I want LogIn and SignUp buttons. On collapsing the brand name, search button and the bars for opening the menu should be shown in same line.
Can somebody please tell how to do it? 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;
}
}
I drew up this example for you, this is what I meant by keeping it simple, Feel free to use it and edit for mobile using css3 media queries. p.s you can also use:
for the menu toggle button on the right for mobile and you can also use:
for the ul on the left, Good luck - Millzie :)
I don't really understand if your
search-input
should be visible in xs view but here is something working :Js Fidlle : http://jsfiddle.net/8hrnkbaL/1/
The first problem in your fiddle was that bootstrap was loaded before jQuery, but jQuery must be load in first...
HTML: