torayeff torayeff - 5 months ago 20
CSS Question

Twitter Bootstrap 3.0 Logo in the center of navbar

I want to center my logo in the navbar, can I use or should I use grid layouts inside navbar or I should do something else:

<div class="navbar navbar-fixed-top navbar-inverse" role="navigation">
<div class="navbar-header">
<!-- I want this at the center of navbar -->
<a class="navbar-brand" href="#"><img src="logo.png"/></a>
</div>
</div>

Answer

This has been asked before a few times, like here.

I've set up a jsfiddle similar to your HTML provided, using your Gravatar since your logo wasn't available: http://jsfiddle.net/q68VS/

Important CSS:

.nav-center {
    margin:0;
    float:none;
}

.navbar-inner{
    text-align:center;
}