ul {
list-style-type: none
}
.navbar-nav:hover .secondDropdown{
display:block;
}
.navbar-nav .secondDropdown{
display:none;
}
.navbarDropdown2{
display:none;
}
.dropdown-toggle:hover .navbarDropdown2 {
display: block;
}
.dropdown-item:hover ul{
display: block;
}
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ml-auto">
<li class="nav-item dropdown"><a class="nav-link dropdown-toggle" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Apparel </a>
<ul class="dropdown-menu secondDropdown" aria-labelledby="navbarDropdown">
<li class="dropdown-item dropdown"><a class="dropdown-toggle" href="#" id="navbarDropdown2" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Girls</a>
<ul class="" aria-labelledby="navbarDropdown2">
<li class="dropdown-item dropdown"><a href="/Apparel/Girls/Shoes/10015">Shoes</a></li>
</ul>
</li>
<li class="dropdown-item dropdown"><a class="dropdown-toggle" href="#" id="navbarDropdown2" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Boys</a>
<ul class="" aria-labelledby="navbarDropdown2">
<li class="dropdown-item dropdown"><a href="/Apparel/Boys/Pants/10019">Pants</a></li>
</ul>
</li>
<li class="dropdown-item dropdown"><a class="dropdown-toggle" href="#" id="navbarDropdown2" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Women</a>
<ul class="" aria-labelledby="navbarDropdown2">
<li class="dropdown-item dropdown"><a href="/Apparel/Women/Dresses/10001">Dresses</a></li>
</ul>
</li>
<li class="dropdown-item dropdown"><a class="dropdown-toggle" href="#" id="navbarDropdown2" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Men</a>
<ul class="" aria-labelledby="navbarDropdown2">
<li class="dropdown-item dropdown"><a href="/Apparel/Men/Jackets/10009">Jackets</a></li>
</ul>
</li>
</ul>
</li>
<li class="nav-item dropdown"><a class="nav-link dropdown-toggle" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Electronics </a>
<ul class="dropdown-menu secondDropdown" aria-labelledby="navbarDropdown">
<li class="dropdown-item dropdown"><a class="dropdown-toggle" href="#" id="navbarDropdown2" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Accessories</a>
<ul class="" aria-labelledby="navbarDropdown2"></ul>
</li>
</ul>
</li>
<li class="nav-item dropdown"><a class="nav-link dropdown-toggle" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Grocery </a>
<ul class="dropdown-menu secondDropdown" aria-labelledby="navbarDropdown">
<li class="dropdown-item dropdown"><a class="dropdown-toggle" href="#" id="navbarDropdown2" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dairy</a>
<ul class="" aria-labelledby="navbarDropdown2"></ul>
</li>
</ul>
</li>
<li class="nav-item dropdown"><a class="nav-link dropdown-toggle" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Health </a>
<ul class="dropdown-menu secondDropdown" aria-labelledby="navbarDropdown">
<li class="dropdown-item dropdown"><a class="dropdown-toggle" href="#" id="navbarDropdown2" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Medicine</a>
<ul class="" aria-labelledby="navbarDropdown2"></ul>
</li>
</ul>
</li>
<li class="nav-item dropdown"><a class="nav-link dropdown-toggle" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Home & Furnishing </a>
<ul class="dropdown-menu secondDropdown" aria-labelledby="navbarDropdown">
<li class="dropdown-item dropdown"><a class="dropdown-toggle" href="#" id="navbarDropdown2" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Bath Accessories</a>
<ul class="" aria-labelledby="navbarDropdown2"></ul>
</li>
</ul>
</li>
<li class="nav-item dropdown"><a class="nav-link dropdown-toggle" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Newsletters & Magazines </a>
<ul class="dropdown-menu secondDropdown" aria-labelledby="navbarDropdown">
<li class="dropdown-item dropdown"><a class="dropdown-toggle" href="#" id="navbarDropdown2" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Magazines</a>
<ul class="" aria-labelledby="navbarDropdown2"></ul>
</li>
</ul>
</li>
</ul>
</div>
Hello everyone! I am relatively new to working with CSS and Bootstrap, and have been attempting to create a multi-level dropdown menu using these technologies. However, I seem to be encountering an issue where clicking on any item in the list causes all items to open simultaneously. I have included my code in a FIDDLE for reference, but I'm struggling to identify where I may have made a mistake. Despite experimenting with different values for 'display', I have not been able to resolve the problem.
If anyone could offer guidance or insight into this issue, I would greatly appreciate it. Thank you in advance!