Bootstrap 5 navbar with dropdown and mega menu hover effect
We know about dropdowns and multilevel dropdowns. But some of the eCommerce websites have a mega submenu. We will show large inner menus on hover on each dropdown item, similar to eBay or Alibaba websites. In other words, When you hover on any menu item of the dropdown menu, another large submenu will appear next to it. These kinds of large dropdowns mostly used for e-commerce websites.
Steps to create a responsive dropdown with a large submenu
– Create a navbar with a dropdown menu.
– Add another dropdown-menu after the dropdown-item element (inside li of first level dropdown-menu)
– Add your own class for the second-level dropdown menu, Let’s add classmegasubmenu.
– Now we need to make second level dropdown-menu a bit larger and also set its position to left:100%; top:0; and also sizing min-height: 100%; min-width:500px;
– Show it on mouse hover with CSS
– .dropdown-menu > li:hover .megasubmenu{ display: block; }
The final step is to make it adaptive for mobile devices. Just a few javascript codes
Bootstrap navbar Bootstrap dropdown large submenu. html code example
dropdown large submenu.
Demo for Navbar with megamenu dropdown.
Based on Bootstrap 5 CSS framework.
For this demo page you should connect to the internet to receive files from CDN like Bootstrap5 CSS, Bootstrap5 JS
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.