I have 2 problems finalizing my bootstrap navbar. 1. on click of any of the menu links (while in mobile mode), the menu is not getting hidden 2. when we click on the nav link then the page goes to the inpage link however, the top of that section is masked under the navbar
you can experiment with the code here: https://jsfiddle.net/dandoonian/b504pavg/5/
and here's my navbar code
<nav class="navbar navbar-expand-lg navbar-light bg-light sticky-top">
<a class="navbar-brand" href="#">Navbar</a>
<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">
<a class="nav-item nav-link" href="#section1">Section 1</a>
<a class="nav-item nav-link" href="#section2">Section 2</a>
<a class="nav-item nav-link" href="#section3">Section 3</a>
<a class="nav-item nav-link" href="#section4">Section 4</a>
<a class="nav-item nav-link" href="#section5">Section 5</a>
<a class="nav-item nav-link" href="#section6">Section 6</a>
</div>
</div>
</nav>
i have recorded a small video showing what's happening. https://youtu.be/olA7ddDKsWk
P.S. this is bootstrap code out of the box, didn't modify anything to it, just added content and renamed the links