Currently, I am in the process of creating a basic website with bootstrap5 (no JS at the moment). One issue I am facing is when I shrink the screen to the point where the navigation bar transforms into a burger button. Whenever I click on the burger button and the menu expands, I want the margin-top of the element below to increase so that the menu does not overlap with it.
I have attempted to solve this problem with various methods in JavaScript, but nothing has seemed to work so far. Here is a snippet of my code:
<nav class="navbar navbar2 navbar-expand-lg navbar-light bg-white">
<div class="container-fluid">
<button class="navbar-toggler" id="button-burger" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav navbar-center2">
.........
.........
.........
.........
</nav>
<div class="container-fluid nav-wrapper" id="container-below-header">
Essentially, what I am aiming to achieve is to dynamically alter the class of the below div every time the burger button is clicked. Your insights and assistance on this matter would be greatly appreciated!