I'm currently in the process of developing a Bootstrap website and was wondering whether it is feasible to add a background color to the expanded navbar specifically on small screens. Feel free to refer to the images below for a visual representation of what I have in mind:
Essentially, I am interested in having a distinct background color appear when the hamburger menu is clicked and the menu expands. On larger screens, this background color should also be present.
I am aware of how to modify the background color of a navbar as a whole, but I am specifically inquiring about the possibility of applying it only to the expanded menu.
Edit: Below is an excerpt from my navbar code:
<nav class="navbar navbar-expand-md navbar-light bg-light"> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="navbarNavAltMarkup"> <div class="navbar-nav w-75 m-auto justify-content-around"> <a class="nav-item nav-link active" href="#">About Us <span class="sr-only">(current)</span></a> <a class="nav-item nav-link" href="#">Products</a> <a class="nav-item nav-link" href="#">Specialties</a> <a class="nav-item nav-link" href="#">Contact</a> </div> </div> </nav>