Bootstrap Navbar中未清除徽标的菜单项

时间:2013-12-16 15:47:25

标签: jquery html css twitter-bootstrap-3 navbar

我正在将我公司的网站从Bootstrap 2更新到Bootstrap 3,我认为这是一个相对简单的问题需要解决;菜单项未清除导航栏中的徽标。将菜单项拉到右侧似乎无法解决问题,因为当菜单折叠时,项目仍然在右侧。

以下是开发中site的链接。

以下是导航的代码:

<div class="navbar-wrapper">
  <div class="container">

    <div class="navbar navbar-inverse navbar-static-top wrapper" role="navigation">
      <div class="container">
        <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="index.html"><img src="img/tsp-logo.png" class="logo img-responsive" alt="Third Sector Publishing" /></a>
        </div>
        <div class="navbar-collapse collapse">
          <ul class="nav navbar-nav">
            <li><a href="index.html#about"><i class="fa fa-question-circle"></i> About</a></li>
            <li class="active"><a href="#"><i class="fa fa-users"></i> Team</a></li>
            <li class="scroll"><a href="#contact"><i class="fa fa-envelope-o"></i> Contact</a></li>
            <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-book"></i> Products <b class="caret"></b></a>
              <ul class="dropdown-menu">
                <li class="scroll"><a href="#cww">Canadian Who's Who</a></li>
              <li class="scroll"><a href="#cdg">Canadian Donor's Guide</a></li>
              <li class="scroll"><a href="#cc">CharityCAN</a></li>
              </ul>
            </li>
          </ul>
        </div>
      </div>
    </div>

  </div>
</div>

4 个答案:

答案 0 :(得分:1)

您应该移除position:absolute上的.logostyle.css样式表的第76行。

答案 1 :(得分:0)

需要添加类似

的内容
.navbar-brand {
  width: 386px;/*width of the logo image*/
}

为了navbar-brand链接占用必要的空间。

答案 2 :(得分:0)

在bootstrap.min.css的第7行,你需要在这个类上添加这个css样式 .navbar-inverse .navbar-collapse, .navbar-inverse .navbar-form {float: right; margin: 0 14px 0 0;}

或者您可以在导航栏"pull-right"上添加此类名称,该名称已在bootstrap css上定义

答案 3 :(得分:0)

http://jsbin.com/OtamALu/1/

您希望徽标不会进入导航状态。

   <div class="navbar navbar-inverse navbar-static-top" role="navigation">
  <div class="container">
    <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>

      <div class="logo-wrapper">
      <a href="index.html"><img src="http://www.accomplicated.ca/webdesign/TSP-3/img/tsp-logo.png" class="logo img-responsive" alt="Third Sector Publishing" /></a>
      </div>

    </div>
    <div class="navbar-collapse collapse navbar-right">
      <ul class="nav navbar-nav">
        <li><a href="index.html#about"><i class="fa fa-question-circle"></i> About</a></li>
        <li class="active"><a href="#"><i class="fa fa-users"></i> Team</a></li>
        <li class="scroll"><a href="#contact"><i class="fa fa-envelope-o"></i> Contact</a></li>
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-book"></i> Products <b class="caret"></b></a>
          <ul class="dropdown-menu">
            <li class="scroll"><a href="#cww">Canadian Who's Who</a></li>
          <li class="scroll"><a href="#cdg">Canadian Donor's Guide</a></li>
          <li class="scroll"><a href="#cc">CharityCAN</a></li>
          </ul>
        </li>
      </ul>
    </div>
  </div>
</div>

CSS:

  .logo {padding-right:80px;min-with:200px;}
  .logo-wrapper {max-width:400px;padding-top:8px}