2012-06-29 141 views
0

我有一個導航欄,其中有4個元素。第一個只是一個家庭鏈接,第二個和第三個下拉菜單,第四個拉下右鍵。Twitter引導下拉菜單出現在錯誤的菜單項

現在,第二個和第三個元素的下拉列表總是在第一個菜單項下顯示,而不是在單擊下的下拉菜單項下。

第四個沒有這個問題,我做錯了什麼?

<div class="navbar navbar-fixed-top"> 
    <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> 
     <a class="brand" href="#"><span class="blue">art</span><span class="black">ly.de</span></a> 
     <div class="pull-right"> 
     <ul class="nav"> 
      <li class="divider-vertical"></li> 
      <li> 
      <a href="#" class="dropdown-toggle" data-toggle="dropdown"> 
       <i class="icon-user"></i> Patrick Fraley 
       <span class="icon-caret-down"></span> 
      </a> 
      <ul class="dropdown-menu"> 
       <li><a href="#"><i class="icon-edit"></i> Profile</a></li> 
       <li><a href="#"><i class="icon-cog"></i> Account Settings</a></li> 
       <li class="divider"></li> 
       <li><a href="#"><i class="icon-signout"></i> Sign Out</a></li> 
      </ul> 
      </li> 
     </ul> 
     </div> 
     <div class="nav-collapse"> 
     <ul class="nav"> 
      <li class="active"><a href="#">Dashboard</a></li> 
      <li> 
      <a href="#" class="dropdown-toggle" data-toggle="dropdown"> 
       Elements 
       <span class="icon-caret-down"></span> 
      </a> 
      <ul class="dropdown-menu"> 
       <li><a href="#">Calendar</a></li> 
       <li><a href="#">Forms</a></li> 
       <li><a href="#">Graphs</a></li> 
       <li><a href="#">Tables</a></li> 
       <li><a href="#">Typography</a></li> 
      </ul> 
      </li> 
      <li> 
      <a href="#" class="dropdown-toggle" data-toggle="dropdown"> 
       Pages 
       <span class="icon-caret-down"></span> 
      </a> 
      <ul class="dropdown-menu"> 
       <li><a href="#">Login</a></li> 
       <li class="divider"></li> 
       <li><a href="#">Error 404</a></li> 
       <li><a href="#">Error 500</a></li> 
      </ul> 
     </ul> 
     </div><!--/.nav-collapse --> 
    </div> 
    </div> 
</div> 

回答

3

我想你持有的下拉菜單你.nav li小號忘記class="dropdown"

而且你還錯過了一個</li>

<div class="navbar navbar-fixed-top"> 
    <div class="navbar-inner"> 
     <div class="container"> 
      <!-- ... --> 
      <div class="pull-right"> 
       <ul class="nav"> 
        <li class="divider-vertical"/> 
        <li class="dropdown"> 
         <!-- ... --> 
        </li> 
       </ul> 
      </div> 
      <div class="nav-collapse"> 
       <ul class="nav"> 
        <li class="active"> 
         <!-- ... --> 
        </li> 
        <li class="dropdown"> 
         <!-- ... --> 
        </li> 
        <li class="dropdown"> 
         <!-- Missed this /li --> 
        </li> 
       </ul> 
      </div> 
      <!--/.nav-collapse --> 
     </div> 
    </div> 
</div> 
+0

謝謝你,做到了:)不知道李有有類下拉。 – PWFraley