The challenge
Encountering a scrolling anomaly with the Navigation Bar, Body, and Footer while utilizing Bootstrap 4. Everything appears to function smoothly on the desktop view. The glitch arises when I reduce the viewport size. The body fails to stay in place, making it impossible to scroll when it is positioned between the navbar and the footer.
I'm perplexed as to why the following code snippet is present in my navbar:
<div style="padding-block-end: 200px;">
{{> navbar}}
</div>
Additionally, the beginning of my content gets partially obscured by the navigation bar.
:root {
--navbar-bg-color: hsl(0, 0%, 15%);
--navbar-text-color: hsl(0, 0%, 85%);
--navbar-text-color-focus: white;
--navbar-bg-contrast: hsl(0, 0%, 25%);
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
height: 100vh;
font-family: Arial, Helvetica, sans-serif;
line-height: 1.6;
}
.container {
max-width: 1000px;
padding-left: 1.4rem;
padding-right: 1.4rem;
...
...
@media screen and (max-width:1000px) {
.first {
text-align: center;
}
.first h4::after {
left: 40%;
}
}
.margin {
margin-left: 20px;
}
.container h1 {
text-align: center;
margin-top: 100px;
margin-bottom: 100px;
}
<!-- Font Awesome -->
<script src="https://kit.fontawesome.com/a076d05399.js"></script>
<!-- Navigation Bar -->
<header id="navbar">
<nav class="navbar-container container navbar-default navbar-fixed-top">
<a href="/" class="home-link">
<div class="navbar-logo"></div>
</a>
<button type="button" class="navbar-toggle" aria-label="Open navigation menu">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="navbar-menu">
<ul class="navbar-links">
<li class="navbar-item"><a class="navbar-link" href="/">home</a></li>
<li class="navbar-item"><a class="navbar-link" href="/">...</a></li>
<li class="navbar-item"><a class="navbar-link" href="/">...</a></li>
<li class="navbar-item"><a class="navbar-link" href="/">...</a></li>
</ul>
</div>
</nav>
</header>
...
<!-- Footer -->
<div class="footer">
<div class="container">
<div class="container">
<div class="row">
<div class="col-12">
<div class="line"></div>
<div class="second2">
<a href="https://codepen.io/AndreeaBunget" target="_blank"> <i class="fab fa-codepen fa-2x margin"></i></a>
<a href="" target="_blank"> <i class="fab fa-github fa-2x margin"></i></a>
<a href="" target="_blank"> <i class="fab fa-linkedin fa-2x margin"></i></a>
<a href="https://www.youtube.com/channel/UCX674BUbomzBCakbb75lhfA?view_as=subscriber" target="_blank"><i class="fab fa-youtube fa-2x margin"></i></a>
</div>
</div>
</div>
</div>
</div>
</div>