Is there a way to make the bootstrap navbar overlap with the carousel without causing any issues with #test?
HTML
<nav class="navbar navbar-expand-lg navbar-dark bg-dark floating-navbar">
<div class="container">
<a class="navbar-brand" href="#">Logo</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-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 ml-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Best Sellers</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Gift Ideas</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">New Releases</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Today's Deals</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Customer Service</a>
</li>
</ul>
</div>
</div>
</nav>
<div id="fullCarousel" class="carousel slide" data-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
<img src="https://source.unsplash.com/1600x900/?nature,water" class="d-block w-100" alt="Carousel Image 1">
</div>
<div class="carousel-item">
<img src="https://source.unsplash.com/1600x900/?nature,car" class="d-block w-100" alt="Carousel Image 2">
</div>
<div class="carousel-item">
<img src="https://source.unsplash.com/1600x900/?nature,water" class="d-block w-100" alt="Carousel Image 2">
</div>
<div class="carousel-item">
<img src="https://source.unsplash.com/1600x900/?nature,forest" class="d-block w-100" alt="Carousel Image 2">
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleControls" 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="#carouselExampleControls" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
<div id="test">
<h1> Lorem ipsum dolor sit amet consectetur adipisicing elit. Enim necessitatibus nemo consectetur, ipsa eaque
similique
totam voluptas magnam dolore veritatis repudiandae perferendis odio ad at maxime atque asperiores ratione quis!
</h1>
</div>
When it comes to CSS, the issue arises with #full carousel. How can we ensure that #test comes after the carousel without causing alignment problems?
CSS
html,
body {
height: 100vh;
}
.carousel {
top: 0;
z-index: 1;
}
.carousel-inner {
height: 80vh;
}
.carousel-inner img {
margin: auto;
display: inline-block;
}
.navbar {
position: relative;
z-index: 2;
margin-top: 10px;
border-radius: 40px;
}
#fullCarousel {
position: absolute;
width: 100%;
top: 0;
z-index: 1;
}
}
Any suggestions on resolving the issue with #full carousel are welcome!