I recently started using bootstrap 3 and I'm trying to align my navbar to the center. I managed to achieve this with the help of this method, which is working well.
Now, my issue is that the width of my navbar-brand element is affecting the position of the centered content. For example, when the branding gets bigger, the elements start moving to the left. Is there a way to position an element of the navbar at the actual center of the screen?
Currently, it looks like this:
https://i.sstatic.net/fCsor.png
But I want it to be at the real center of the screen like this, but with the brand:
https://i.sstatic.net/0MaAe.png
Here is my HTML:
<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="#navbar" aria-expanded="false" aria-controls="navbar">
<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 navbar-left" href="#"></a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Services<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">Stuff</a></li>
</ul>
</li>
<li><a href="#about">Karriere</a></li>
<li><a href="#contact">Über uns</a></li>
<li><a href="#contact">Kontakt</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
@media (min-width: $grid-float-breakpoint) {
.navbar .navbar-nav {
display: inline-block;
float: none;
vertical-align: top;
}
.navbar .navbar-collapse {
text-align: center;
}
}