以下是我网站菜单的屏幕截图。在我的移动版网站中,我试图删除这四个大标签之间的界限,并使它们与上面的主页标签相同。
这是我的代码:
<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 :(得分:0)
将所有内容放在 li&lt;&gt;内标记,希望在下拉列表中显示, 如需进一步参考,请查看我的plunker。
edit like this