如何在导航上添加下拉菜单

时间:2018-12-03 07:04:32

标签: c# html

我试图在导航的布局页面上添加下拉菜单。到目前为止,我可以看到页面admin出现了下拉值,但外观与其他导航项不同。另一个问题是,如果单击下拉列表,选择值将显示在最左侧的页面上。

这是我当前的脚本:

 <html>
 <body>

 <div class="navbar">
    <div class="container" style="border-style: groove;">
        <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", "Main", "Home", new { area = "" }, new { @class = "navbar-brand", style = "color: #8C8D8E;" })
            @Html.ActionLink("Name List", "Name", "Home", new { area = "" }, new { @class = "navbar-brand", style = "color: #8C8D8E;" })
            @Html.ActionLink("Details", "Details", "Home", new { area = "" }, new { @class = "navbar-brand", style = "color: #8C8D8E;" }    

             <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                Page Admin
                <span class="caret"></span>
                <ul class="dropdown-menu" role="menu">
                    <li>@Html.ActionLink("Reports", "reports", "Home", new { area = "" }, new { @class = "navbar-brand" })</li>
                    <li>@Html.ActionLink("Uttils", "utils", "Home", new { area = "" }, new { @class = "navbar-brand" })</li>
                </ul>
            </a>


        </div>
        <div class="navbar-collapse collapse">
            <ul class="nav navbar-nav"></ul>
        </div>
    </div>
</div>

</html>
</body>

0 个答案:

没有答案