2017-08-30 63 views
0

下面是我的網站菜單的屏幕截圖。在我的移動版本的網站中,我試圖刪除這四個大標籤之間的界限,並使它們與上面的Home標籤相同。NavBar無法在移動版本中正常工作

enter image description here

這裏是我的代碼:

<div class="navbar navbar-inverse 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> 
       @Html.ActionLink("Home", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" }) 
      </div> 
      <div class="navbar-collapse collapse"> 
       <ul class="nav navbar-nav"> 
        <li>@Html.ActionLink("About", "About", "Home")</li> 
        <li>@Html.ActionLink("Contact", "Contact", "Home")</li> 

       </ul> 
       @Html.Partial("_LoginPartial") 


      </div> 
     </div> 
    </div> 

,這裏是我的_LoginPartial.cshtml的代碼文件

<ul class="nav navbar-nav navbar-right" > 
     <li> 
      @using (Html.BeginForm("index", "App", FormMethod.Post, new { id = "seminarForm", @class = "navbar-form" })) 
      { @Html.AntiForgeryToken() 
       <a class="btn btn-default" href="javascript:document.getElementById('seminarForm').submit()">Seminar</a> 
       @*@<li>@Html.ActionLink("Seminars", "index", "App")</li> *@ 
      } 
     </li> 
</ul> 
+0

看起來你正在使用的導航欄3.X,而不是[引導4導航欄(https://getbootstrap.com/docs/4.0/components/navbar/) – ZimSystem

+0

你有適當的CSS和JS加載在您的網頁? https://getbootstrap.com/docs/4.0/getting-started/introduction/ – mlegg

回答

0

李<>標籤,裏面放這一切想要顯示在下拉列表中, 進一步的參考檢查我的plunke河

edit like this 

https://plnkr.co/edit/5gvJYTgRcp6WzrN9cIOd?p=preview

+0

我做到了,它仍然不起作用。這是我的文件代碼_LoginPartial.cshtml: – User123

+0

你的代碼在哪裏? –

+0

放入活塞並分享鏈接,我會明天排序 –

相關問題