I am looking to customize the Bootstrap Navbar submenu to display below each navigation item by default, while also scaling the background of the submenu to fill the width of the browser window.
Despite trying various solutions, I have been unsuccessful in achieving this effect. Currently, my attempt involves using :before
to set a background, but even that has not worked. Is there a viable solution for this issue?
You can review my code progress here: https://codepen.io/cray_code/pen/QXNVLK
In the provided code, you will notice that there is a full-width dropdown solution available. However, my goal is to have the submenu items positioned below their parent menu item, rather than at the left side.
The following CSS is specifically for achieving the full-width version, with no alterations made to the HTML structure of the navbar:
.navbar-full .dropdown-menu {
position: absolute !important;
left: 0 !important;
right: 0 !important;
}
.navbar-full .dropdown, .navbar-full .navbar-nav .nav-item.dropdown {
position: static !important;
}