简体   繁体   中英

bootstrap navigation bar side by side

How can i make a nav bar like this in bootstrap

在此处输入图片说明

I tried this code:

<!-- Navigation bar -->
    <div class="navbar navbar-inverse navbar-fixed-top">

        <!-- Navigation bar content -->
        <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>

                <!-- Organization name -->
                <a class="brand" href="/">Test</a>

                <!-- Tabs -->
                <div class="nav-collapse collapse">
                  <ul class="nav">
                      <li class="divider-vertical"></li>
                      <li><a href="index/FLT.do"><i class="icon-pencil icon-white"></i> Test</a></li>
                  </ul>

                  <!-- Sign in -->
                  <ul class="nav pull-right">
                        <li class="divider-vertical"></li>
                        <li>
                            <a href="#login_modal" data-toggle="modal" >Sign In</a>
                        </li>
                    </ul>

                </div>
                <!-- /.Tabs -->

            </div>
        </div>
        <!-- /.Content -->

    </div> <!-- /.Navigation bar content -->

     <div class="container-fluid">
        <div class="row-fluid">

            <div class="span2">
                <!-- Left Navbar -->
                <div class="navbar navbar-static-top">
                  <div class="navbar-inner">
                    <a class="brand" href="#">Title</a>
                  </div>
                </div>

            </div>

            <div class="span10">
                <!-- Right Navbar -->
                <div class="navbar navbar-static-top">
                  <div class="navbar-inner">
                    <a class="brand" href="#">Title</a>
                  </div>
                </div>

            </div>

        </div>
    </div> 

Which will result to this:

在此处输入图片说明

I tried also in-line styling but I red in the net that it is not a good practice, I also tried overidding the classes that ruin the bootstrap. It has spaces between. Is't possible to do this with just bootstrap or no inline styling?

The space that you see between columns is called Gutter Width. I had the same problem in one of my projects. If you don't want to modify any CSS, then I suggest you get a customized bootstrap. You can modify the Grid System .

Customize Bootstrap at http://getbootstrap.com/2.3.2/customize.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM