How to reach the submenu

I am coding the following in Bootstrap 3.0 and MVC 5. I am trying to get Submenus to work. I referenced the navigation documentation , but I cannot get the Billing and Payment structure to be the drop-down menu below with this structure:

Account Info
    License Details
    Billing and Payment
       Invoices
       Payments
       Billing
    Users
       User Settings

Here is my HTML. I need to replace the anchor tag with a payment payment. What do I put in his place?

<div class="navbar-collapse collapse">
                <ul class="nav navbar-nav">
                    <li>@Html.ActionLink("Home", "Index", "Home")</li>
                    <li>@Html.ActionLink("About", "About", "Home")</li>
                    <li>@Html.ActionLink("Free Trial Setup", "Trial", "Home")</li>
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Account Info</a>
                        <ul class="dropdown-menu">
                            <li>@Html.ActionLink("License Details", "License", "Home" )</li>
                            <li class="dropdown-submenu"></li>
                                <a href="#">Billing and Payment</a>
                                <li>@Html.ActionLink("Invoices", "Invoices", "Home")</li>
                                <li>@Html.ActionLink("Payments", "Payments", "Home")</li>
                                <li>@Html.ActionLink("Billing Information", "Billing", "Home")</li>
                            </ul>
                            <li>User Settings</li>
                        </ul>

                    </li>
                </ul>
                @Html.Partial("_LoginPartial")
            </div>
        </div>
+4
source share
1 answer

Based on the solution mentioned in snippet , you should do the following:

  • Add the following Site.css file

    .dropdown-submenu {
    position: relative; 
    }
    
    .dropdown-submenu > .dropdown-menu {
        top: 0;
        left: 100%;
        margin-top: -6px;
        margin-left: -1px;
        -webkit-border-radius: 0 6px 6px 6px;
        -moz-border-radius: 0 6px 6px;
        border-radius: 0 6px 6px 6px;
    }
    
    .dropdown-submenu:hover > .dropdown-menu {
        display: block;
    }
    
    .dropdown-submenu > a:after {
        display: block;
        content: " ";
        float: right;
        width: 0;
        height: 0;
        border-color: transparent;
        border-style: solid;
        border-width: 5px 0 5px 5px;
        border-left-color: #ccc;
        margin-top: 5px;
        margin-right: -10px;
    }
    
    .dropdown-submenu:hover > a:after {
        border-left-color: #fff;
    }
    
    .dropdown-submenu.pull-left {
        float: none;
    }
    
        .dropdown-submenu.pull-left > .dropdown-menu {
            left: -100%;
            margin-left: 10px;
            -webkit-border-radius: 6px 0 6px 6px;
            -moz-border-radius: 6px 0 6px 6px;
            border-radius: 6px 0 6px 6px;
        }
    

then change your code in _Layout.cshtml to be:

<div class="navbar-collapse collapse">
                <ul class="nav navbar-nav">
                    <li>@Html.ActionLink("Home", "Index", "Home")</li>
                    <li>@Html.ActionLink("About", "About", "Home")</li>
                    <li>@Html.ActionLink("Free Trial Setup", "Trial", "Home")</li>
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Account Info</a>
                        <ul class="dropdown-menu multi-level" role="menu" aria-labelledby="dropdownMenu">
                            <li>@Html.ActionLink("License Details", "License", "Home")</li>
                            <li class="dropdown-submenu">
                                <a tabindex="-1" href="#">Billing and Payment</a>
                                <ul class="dropdown-menu">
                                    <li>@Html.ActionLink("Invoices", "Invoices", "Home")</li>
                                    <li>@Html.ActionLink("Payments", "Payments", "Home")</li>
                                    <li>@Html.ActionLink("Billing Information", "Billing", "Home")</li>
                                    <li class="dropdown-submenu">
                                        <a href="#">Users</a>
                                        <ul class="dropdown-menu">
                                            <li><a href="#">User Settings</a></li>
                                        </ul>
                                    </li>
                                </ul>
                            </li>
                        </ul>
                    </li>
                </ul>
                @Html.Partial("_LoginPartial")
            </div>
0
source

Source: https://habr.com/ru/post/1526208/


All Articles