I need to make the dropdown menu as this page without the content, that occupies all the width of the page. I also need to make all the "lorem" links of the menu central in the navbar. I’m not able to edit bootstrap classes so I can’t make this. How can I fix that? (please open it in full page, and i don’t know why with the code snipped the hover menu doesn’t work)
.navbar-nav {
display: flex;
justify-content: space-between;
align-items: center;
}
.navbar a:hover {
text-decoration: underline;
}
.navbar-nav {
display: flex;
align-items: center;
justify-content: space-between;
}
.dropdown-menu {
font-size: 0.8rem;
left: 0;
border: none;
text-align: center;
position: absolute;
border-radius: 0;
box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
display: grid;
grid-template-columns: auto auto auto auto auto;
visibility: hidden;
min-width: 100%;
z-index: 999;
}
.dropdown:hover .dropdown-menu {
visibility: visible;
}
.dropdown-menu.show {
display: flex;
}
.dropdown-menu a:hover {
color: darkgrey;
text-decoration: none;
}
.dropdown-menu li:first-child a {
color: darkgrey;
padding: 20px 0;
}
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-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 me-auto mb-2 mb-lg-0">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="" role="button" data-bs-toggle="dropdown" aria-expanded="false">Lorem</a>
<div class="dropdown-menu">
<ul>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
</ul>
<ul>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
</ul>
<ul>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
</ul>
<ul>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
</ul>
<ul>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
</ul>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="" role="button" data-bs-toggle="dropdown" aria-expanded="false">Lorem</a>
<div class="dropdown-menu">
<ul>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
</ul>
<ul>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
</ul>
<ul>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
</ul>
<ul>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
</ul>
<ul>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
</ul>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="" role="button" data-bs-toggle="dropdown" aria-expanded="false">Lorem</a>
<div class="dropdown-menu">
<ul>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
</ul>
<ul>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
</ul>
<ul>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
</ul>
<ul>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
</ul>
<ul>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
</ul>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="" role="button" data-bs-toggle="dropdown" aria-expanded="false">Lorem</a>
<div class="dropdown-menu">
<ul>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
</ul>
<ul>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
</ul>
<ul>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
</ul>
<ul>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
</ul>
<ul>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
</ul>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="" role="button" data-bs-toggle="dropdown" aria-expanded="false">Lorem</a>
<div class="dropdown-menu">
<ul>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
</ul>
<ul>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
</ul>
<ul>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
</ul>
<ul>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
</ul>
<ul>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
</ul>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="" role="button" data-bs-toggle="dropdown" aria-expanded="false">Lorem</a>
<div class="dropdown-menu">
<ul>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
</ul>
<ul>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
</ul>
<ul>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
</ul>
<ul>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
</ul>
<ul>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
<li><a class="dropdown-item" href="">Lorem Ipsum</a></li>
</ul>
</div>
</li>
</ul>
</div>
</div>
</nav>
2
Answers
Did you add the srcipt tags for the js code?
To use bootstap, you need both popperjs and the bootstrap js code.
reference:
https://getbootstrap.com/docs/5.3/getting-started/download/#cdn-via-jsdelivr
Add JS Script’s and you are missing them?