locked
want to use bootstarp navbar dropdown list in .net core _layout RRS feed

  • Question

  • User439135325 posted

    <li class="dropdown">
    <a class="dropdown-toggle" data-toggle="dropdown"
    asp-area="" asp-controller="Staffs" asp-action="Index">
    Staff
    <span class="caret"></span>
    </a>
    <ul class="dropdown-menu">
    <li><a asp-area="" asp-controller="Staffs" asp-action="Index">Staff</a></li>
    <li><a asp-area="" asp-controller="Certificates" asp-action="Index">Certificate</a></li>
    </ul>

    </li>

    Thursday, July 19, 2018 9:04 AM

Answers

  • User541108374 posted

    Hi,

    you can try one here: https://www.w3schools.com/bootstrap4/tryit.asp?filename=trybs_navbar_dropdown&stacked=h

    For Bootstrap 4:

    <nav class="navbar navbar-expand-sm bg-dark navbar-dark">
      <!-- Brand -->
      <a class="navbar-brand" href="#">Logo</a>
    
      <!-- Links -->
      <ul class="navbar-nav">
        <li class="nav-item">
          <a class="nav-link" href="#">Link 1</a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="#">Link 2</a>
        </li>
    
        <!-- Dropdown -->
        <li class="nav-item dropdown">
          <a class="nav-link dropdown-toggle" href="#" id="navbardrop" data-toggle="dropdown">
            Dropdown link
          </a>
          <div class="dropdown-menu">
            <a class="dropdown-item" href="#">Link 1</a>
            <a class="dropdown-item" href="#">Link 2</a>
            <a class="dropdown-item" href="#">Link 3</a>
          </div>
        </li>
      </ul>
    </nav>

    Kris.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, July 19, 2018 10:18 AM