I'm currently using Bootstrap4 and I am trying to implement a collapsible menu on mobile that spans the full width of the screen and has a different background color compared to my navbar.
Initially, I applied a background color to the navbar-collapse element, which worked fine. However, the issue arises when the navbar has padding because this padding also affects the collapsible menu. If I try to override the padding of the navbar class, it causes misalignment between the brand logo and the burger menu icon.
Below is the code snippet I am working with:
<nav class="navbar bg-light navbar-light floating navbar-expand-sm cm-navbar" id="mj-topbar">
<div class="container">
<a class="navbar-brand nb-brand" href="/index.php">My Brand</a>
<button type="button" class="navbar-toggler nb-hamburger-button" data-toggle="collapse" data-target="#collapseCoreNav" aria-controls="collapseCoreNav" aria-expanded="true" aria-label="Toggle Navigation">
<span class="navbar-toggler-icon"></span></button>
<div class="navbar-collapse collapse show" id="collapseCoreNav" style="">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="btn_ tdbLink fa-angle-right_ nav-link" href="/">Home</a>
</li>
<li class="nav-item">
<a class="btn_ tdbLink fa-angle-right_ nav-link" href="/login.php">Login</a>
</li>
</ul>
</div>
</div>
</nav>
Is there a way to achieve this desired layout without having to modify the CSS extensively?