Html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script>
$(window).scroll(function(){
if ($(window).scrollTop() > 20) {
$('.navbar').addClass('scroll');
}
else {
$('.navbar').removeClass('scroll')
}
});
</script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
<link rel="stylesheet" href="main.css">
<title>devAid</title>
</head>
<body>
<nav class="navbar navbar-top">
<a href="#" class="nav-link"></a>
<a href="#" class="nav-link"></a>
<a href="#" class="nav-link"></a>
<a href="#" class="nav-link"></a>
</nav>
<div class="container-fluid weldiv w-100"></div>
<div class="next"></div>
</body>
</html>
CSS
body, html {
height:100%;
}
.weldiv {
background-color: #17BAEF;
height:100%;
}
.navbar {
position: fixed;
top: 0;
left: 0;
right: 0;
}
.navbar-top {
background: #eee;
}
.next {
height:1000px;
}
.scroll {
background-color: red
}