2017-11-25 95 views
0

這是我迄今爲止,包括導航鏈接..問題是「畫廊(最後一個鏈接)」不與其他鏈接對齊。導航欄中的垂直中心下拉菜單使用引導

<nav class="navbar justify-content-center navbar-expand-lg"> 
<ul class="nav"> 
    <li class="nav-item"> 
    <a class="nav-link" href="home.html">Home</a> 
    </li> 
    <li class="nav-item"> 
    <a class="nav-link" href="about.html">About</a> 
    </li> 
    <li class="nav-item"> 
    <a class="nav-link" href="blog.html">Blog</a> 
    </li> 
    <li class="nav-item"> 
    <a class="nav-link" href="contact.html">Contact</a> 
    </li> 
    <li class="dropdown"> 
    <a class="dropdown-toggle" data-toggle="dropdown" href="#">Gallery 
     <span class="caret"></span></a> 
     <ul class="dropdown-menu"> 
     <li><a href="#">Smiles</a></li> 
     <li><a href="#">Cry's</a></li> 
     <li><a href="#">Videos</a></li> 
     <li><a href="#">Choreography</a></li> 
     <li><a href="#"></a></li> 
     </ul> 
     </li> 
    </ul> 
    </nav> 
+0

請閱讀[如何創建一個最小的,完整的,並且可驗證的示例](https://stackoverflow.com/help/mcve)。 – NullDev

回答

0

您可以添加類nav-itemli,並nav-linka

像這樣:

<nav class="navbar justify-content-center navbar-expand-lg"> 
    <ul class="nav"> 
     <li class="nav-item"> 
      <a class="nav-link" href="home.html">Home</a> 
     </li> 
     <li class="nav-item"> 
      <a class="nav-link" href="about.html">About</a> 
     </li> 
     <li class="nav-item"> 
      <a class="nav-link" href="blog.html">Blog</a> 
     </li> 
     <li class="nav-item"> 
      <a class="nav-link" href="contact.html">Contact</a> 
     </li> 
     <li class="dropdown nav-item"> 
      <a class="dropdown-toggle nav-link" data-toggle="dropdown" href="#">Gallery 
       <span class="caret"></span> 
      </a> 
      <ul class="dropdown-menu"> 
       <li> 
        <a href="#">Smiles</a> 
       </li> 
       <li> 
        <a href="#">Cry's</a> 
       </li> 
       <li> 
        <a href="#">Videos</a> 
       </li> 
       <li> 
        <a href="#">Choreography</a> 
       </li> 
       <li> 
        <a href="#"></a> 
       </li> 
      </ul> 
     </li> 
    </ul> 
</nav> 
+0

謝謝sooo!像魅力一樣工作! @AstenMiles –

+0

我的榮幸J. Eman – Sbe88

+0

正確...謝謝@AstenMies –