Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

HTML & CSS Sub Menu Dropdown Code Assist

Lost Kakashi

New Coder
I have a menu for my Dashboard that I use with some coworkers but I'm having trouble adding submenu to the Categories in Reports. I have pasted the default code that has FORMS>MECHANICAL. What I can't figure out is how to add another submenu in Mechanical so I can search project numbers in that category.

It should be something like this:
FORMS>MECHANICAL>2100
FORMS>MECHANICAL>2101

HTML:
<body>

<nav class="navbar navbar-expand-lg navbar-light bg-light">
  <a class="navbar-brand" href="#">DASHBOARD</a>
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>

  <div class="collapse navbar-collapse" id="navbarSupportedContent">
    <ul class="navbar-nav mr-auto">
    
    <li class="nav-item">
        <a class="nav-link" href="#">HOME<span class="sr-only">(current)</span></a>
    </li>
      
    <li class="nav-item">
        <a class="nav-link" href="#">SAFETY</a>
    </li>
      
    <li class="nav-item">
        <a class="nav-link" href="#">TOOLBOX</a>
    </li>
            
    <li class="nav-item">
        <a class="nav-link" href="#">FORMS</a>
    </li>
    
    <li class="nav-item dropdown">
        <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
          REPORTS
        </a>
        <div class="dropdown-menu" aria-labelledby="navbarDropdown">
          <a class="dropdown-item" href="#">MECHANICAL</a>
          <a class="dropdown-item" href="#">PLUMBING</a>
          <a class="dropdown-item" href="#">HVAC / DUCTWORK</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="#">SURVEY</a>
        </div>
    </li> 
      
    </ul>
  </div>
</nav>
    
</body>



Here is the CSS if needed to review:
CSS:
/* Underline Effect*/
.nav-item {
  position: relative;
}

.navbar-collapse ul li a.nav-link:before {
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: transparent;
    content: '';
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    transform: translateY(10px);
}

.navbar-collapse ul li:hover a.nav-link:before {
    opacity: 1;
    transform: translateY(0px);
    bottom: 0px;
    background: #dd4343;
}

.dropdown-item:hover, .dropdown-item:focus {
    color: #ffffff;
    text-decoration: none;
    background-color: #dd4343;
}

.dropdown-menu {
  border: 0px;
}

/* General Styles*/
body {
  background-image: url(IMG_5046.JPG?auto=compress&cs=tinysrgb&h=750&w=1260);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  height: 100vh;
}
 

New Threads

Latest posts

Buy us a coffee!

Back
Top Bottom