如何自定义bootstrap3导航栏?

时间:2013-10-13 08:12:54

标签: responsive-design twitter-bootstrap-3 navbar

我正在尝试创建一个响应式导航栏,左侧和右侧都有图标,名称在中心对齐。

尝试实现 - http://i40.tinypic.com/2j3o9rb.jpg 目前的输出 - http://i42.tinypic.com/1z3pbuh.jpg

请帮我解决这个问题

<div class="navbar navbar-default navbar-fixed-top">
 <div class="navbar-brand" style="display: inline-block">
  <img class="logo" src="img/qc-icon.png" />
 </div>
 <div class="container">
  <div style="text-align:center"> 
   <span>Name</span>
   <span class="pull-right"><img src="img/qc-icon.png" /></span>
  </div>
 </div> 
</div>

感谢 jetin

1 个答案:

答案 0 :(得分:0)

http://www.bootply.com/117643

    <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
      <div class="container">
        <div class="row">

            <div class="col-md-4">
                <div class="collapse navbar-collapse pull-left">
                  <ul class="nav navbar-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 class="col-md-4">
                <div class="navbar-header">
                  <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="#">Project name</a>
                </div>
            </div>

            <div class="col-md-4">
                <ul class="nav navbar-nav pull-right">
                    <li class=""><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>
    </div>