Bootstrap - 固定导航栏没有达到预期的效果?

时间:2015-06-07 21:20:57

标签: html css twitter-bootstrap navbar

我创建了一个包含列表的导航栏: 活跃的a.k.a.网站名称a.k.a. AnimuTuga;

动画

漫画

博彩股份有限公司

Opinião

Outros(下拉菜单:AMV,Cosplay,Passatempos)

自我

CONTACTO

事情是: - “Opinião”按钮没有出现,我不知道为什么...... - 我想把下拉菜单a.k.a.“Outros”与左边的其他人一样,如Anime和Manga,并将Sobre和Contacto放在右边。

很抱歉这样的菜鸟!这是用于bootstrap btw。这是HTML和CSS。再次抱歉,谢谢!

HTML

!-- Wrap all page content here -->
<div id="wrap">

  <!-- Fixed navbar -->
  <div class="navbar navbar-default navbar-fixed-top">
    <div class="container">
      <div class="navbar-header">
        <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>
        <a class="navbar-brand" href="#">AnimuTuga</a>
      </div>
      <div class="collapse navbar-collapse">
        <ul class="nav navbar-nav">
          <li class="active"><a href="#">Home</a></li>
          <li class="Anime"><a href="#Anime">Anime</a></li>
          <li class="Manga"><a href="#manga">Manga</a></li>
          <li class="Jogos"><a href="#Jogos">Jogos</a></li>
          <li class="Opinião"><a href="#Opinião"></a></li>
          <li class="Outros">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">Outros <b class="caret"></b></a>
            <ul class="dropdown-menu">
              <li><a href="#">AMV</a></li>
              <li><a href="#">Cosplay</a></li>
              <li><a href="#">Passatempos</a></li>
            </ul>
          </li><li><a href="#about">Sobre</a></li>
          <li><a href="#contact">Contacto</a></li>
        </ul>
      </div>
    </div>


  <!-- Begin page content -->
  <div class="container">
    <div class="page-header">
      <h1>Sticky footer with fixed navbar</h1>
    </div>
    <p class="lead">Pin a fixed-height footer to the bottom of the viewport in desktop browsers with this custom HTML and CSS. A fixed navbar has been added within <code>#wrap</code> with <code>padding-top: 60px;</code> on the <code>.container</code>.</p>
    <p>Back to <a href="../sticky-footer">the default sticky footer</a> minus the navbar.</p>
  </div>
</div>

<div id="footer">
  <div class="container">
    <p class="text-muted credit">Example courtesy <a href="http://martinbean.co.uk">Martin Bean</a> and <a href="http://ryanfait.com/sticky-footer/">Ryan Fait</a>.</p>
  </div>
</div>
</div>


            <div id="push"></div>

CSS

/* Sticky footer styles
-------------------------------------------------- */

html,
body {
  height: 100%;
  /* The html and body elements cannot have any padding or margin. */
}

/* Wrapper for page content to push down footer */
#wrap {
  min-height: 100%;
  height: auto !important;
  height: 100%;
  /* Negative indent footer by its height */
  margin: 0 auto -60px;
  /* Pad bottom by footer height */
  padding: 0 0 60px;
}

/* Set the fixed height of the footer here */
#footer {
  height: 60px;
  background-color: #f5f5f5;
}


/* Custom page CSS
-------------------------------------------------- */
/* Not required for template or sticky footer method. */

#wrap > .container {
  padding: 60px 15px 0;
}
.container .credit {
  margin: 20px 0;
}

#footer > .container {
  padding-left: 15px;
  padding-right: 15px;
}

1 个答案:

答案 0 :(得分:2)

尝试改进您的代码:

<li class="Opinião"><a href="#Opinião"></a></li>

为:

<li class="Opiniao"><a href="#Opiniao">Opinião</a></li>

jsfiddle

Explanation,为什么必须更改班级名称。