Centering Navbar content if it's not fixed using Twitter bootstrap?

I am trying to focus "content" on navbar. When it's navbar-fixed-top, the UL menu is centered. However, since I do not want to correct the menu to the top, I delete this class, but now the menus are not centered. He swims on the left side. It should be aligned at the edges of the container. Like http://twitter.github.com/bootstrap/scaffolding.html , but I don't want it to be attached to the top.

enter image description here

This is the code

        <div class="navbar ">
            <div class="navbar-inner">
                <div class="container" >
                    <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </a>
                    <a class="brand" href="#">Project name</a>
                    <div class="nav-collapse">
                        <ul class="nav">
                            <li class="active"><a href="#">Home</a></li>
                            <li><a href="#about">About</a></li>
                            <li><a href="#contact">Contact</a></li>
                        </ul>
                    </div><!--/.nav-collapse -->
                </div>
            </div>
        </div>
+3
source share
2 answers

Use navbar-static-top.

Check the latest bootstrap if it doesn't work.

+6
source

, , 2.0.1, , , , , .

, , CSS:

.navbar-inner > .container { width:940px; }
+3

All Articles