Currently, I am designing a mockup and aiming to create a full-screen carousel with the navigation bar links positioned on top of the images. At the moment, the navbar appears transparent until I scroll down the image/slider making it full screen. How can I ensure that the nav bar displays on top of the carousel upon initial load? I am utilizing BS4 alpha for this project.
Current Placement: View current position of the nav bar during load
Desired Placement: View desired position of the navbar during load
Code Snippet:
html,body {
height:100vh;
}
.carousel, .item, .active {
height:100vh;
}
.carousel {
top: 0;
}
.carousel-inner {
height:100vh;
}
.carousel-inner img {
margin: auto;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" ></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" ></script>
<!-- Navigation Bar -->
<nav class="navbar sticky-top navbar-toggleable-md navbar-light">
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="#">Cold Denver</a>
<!-- Mobile Menu Links inside Nav Bar -->
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<!-- left side nav bar -->
<ul class="navbar-nav ml-auto mt-2 mt-lg-0">
<li class="nav-item">
<a class="nav-link" href="#">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Contact</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Team</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Store</a>
</li>
</ul>
</div>
</nav>
<!-- End Navigation Bar -->
<div id="fullCarousel" class="carousel slide" data-ride="carousel">
<div class="carousel-inner" role="listbox">
<div class="carousel-item active">
<img class="img-fluid" src="http://via.placeholder.com/1920x1080" width="100%" alt="First slide">
</div>
<div class="carousel-item">
<img class="img-fluid" src="http://via.placeholder.com/1920x1080" width="100%" alt="Second slide">
</div>
<div class="carousel-item">
<img class="img-fluid" src="http://via.placeholder.com/1920x1080" width="100%" alt="Third slide">
</div>
<a class="carousel-control-prev" href="#fullCarousel" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#fullCarousel" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>