从标准Bootstrap菜单中删除“Brand”

时间:2013-11-20 11:05:58

标签: twitter-bootstrap twitter-bootstrap-3

如何从Bootstrap中的标准导航栏中删除“Brand”项?

我尝试了很多东西,包括删除HTML,但我似乎无法将内容(菜单项)完全正确地证明。

任何帮助都将不胜感激。

3 个答案:

答案 0 :(得分:2)

Bootstrap 2:

只需用CSS隐藏它:

.brand {display: none !important}

如果您想摆脱空白区域,请添加以下内容:

.navbar-inner {padding-left: 0px}

Fiddle Demo


Bootstrap 3:

参考this post,将其添加到您的CSS:

.navbar .container-fluid, .navbar-collapse {
    padding-left:0;
}
.navbar-collapse.in {
    padding-left:30px;
}

<强> Fiddle Demo

答案 1 :(得分:0)

您使用的是2或3的bootstrap吗? 你能在这个问题中添加你正在使用的HTML吗?

如果您使用的是bootstrap3,请检查此fiddle

<nav class="navbar navbar-default" role="navigation">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span>
 <span class="icon-bar"></span>
 <span class="icon-bar"></span>
 <span class="icon-bar"></span>


    </div>
    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">

        <ul class="nav navbar-nav navbar-right">
            <li><a href="#">Link</a>
            </li>
            <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>

                <ul class="dropdown-menu">
                    <li><a href="#">Action</a>
                    </li>
                    <li><a href="#">Another action</a>
                    </li>
                    <li><a href="#">Something else here</a>
                    </li>
                    <li class="divider"></li>
                    <li><a href="#">Separated link</a>
                    </li>
                </ul>
            </li>
        </ul>
    </div>
    <!-- /.navbar-collapse -->
</nav>

答案 2 :(得分:0)

你可以试试..

<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
  <div class="container">
    <div class="navbar-header pull-right">
      <ul class="nav navbar-nav pull-left">
        <li>
          <a href="#">About&nbsp;</a>
        </li>
      </ul>
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
    </div>
    <div class="navbar-collapse collapse">
      <ul class="nav navbar-nav navbar-right">
        <li><a href="#">Link</a></li>
        <li><a href="#">Link</a></li>
      </ul>                    
    </div>
  </div>
</nav>

演示:http://bootply.com/95491