How can I arrange my grid-layout to get all the items in the nav-bar on one row, with menu items to the left, and some links (or in this example, just one button) to the right?
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header col-lg-12 alert-danger">
<div class="row">
<div class="col-lg-10 alert-info">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">MyStore</a>
</div>
<div class="col-lg-2 navbar-collapse collapse" align="right">
<div class="col-lg-10">
<ul class="nav navbar-nav alert-success">
<li><a href="/Products">Admin</a></li>
</ul>
</div>
<div class="col-lg-2 alert-success">
<a href="/Cart" class="btn btn-success">
<span class="glyphicon glyphicon-shopping-cart">
</span>
Kr 514,00
</a>
</div>
</div>
</div>
</div>
</div>
</nav>
I have added colors to the divs just to be able to see them better. They're all supposed to be one color when the formatting is done.
I'm using un-altered bootstrap.css:
<link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.7/css/bootstrap.min.css">
To me, the grid-layout looks to be correct in the markup, but the rendered result is just a right mess:
Edit
I solved a part of it by adjusting the col-lg-*
. Now I just need to push the button all the way to the right and a bit down, to vertically align everything center inside the nav-bar:
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header col-lg-12">
<div class="row">
<div class="col-lg-1">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">MyStore</a>
</div>
<div class="col-lg-11 navbar-collapse collapse" align="right">
<div class="row">
<div class="col-lg-9">
<ul class="nav navbar-nav">
<li><a href="/Products">Admin</a></li>
</ul>
</div>
<div class="col-lg-3" align="right">
<a href="/Cart" class="btn btn-success">
<span class="glyphicon glyphicon-shopping-cart"></span>
Kr 514,00
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</nav>