background-image: linear-gradient(to top, black 0%, transparent 100%);
Is it possible to implement this gradient in a bootstrap 4
carousel?
I attempted to add it to both the carousel-item
and carousel-inner
classes, but saw no changes.
Below is the structure of my Bootstrap 4 carousel:
<div id="gallery" class="carousel slide" data-ride="carousel" style="margin-top: 6rem;">
<ol class="carousel-indicators">
<li data-target="#gallery" data-slide-to="0" class="active"></li>
<li data-target="#gallery" data-slide-to="1"></li>
<li data-target="#gallery" data-slide-to="2"></li>
<li data-target="#gallery" data-slide-to="3"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
<img src="img/gallery1.jpg" class="d-block w-100 gallery-img" alt="ВИГВАМ">
<div class="carousel-caption">
<h5>item0</h5>
<p>desc</p>
</div>
</div>
<div class="carousel-item">
<img src="img/gallery8.jpg" class="d-block w-100 gallery-img" alt="item">
<div class="carousel-caption">
<h5>item1</h5>
<p>desc</p>
</div>
</div>
<div class="carousel-item">
<img src="img/gallery2.jpg" class="d-block w-100 gallery-img" alt="item">
<div class="carousel-caption">
<h5>item2</h5>
<p>desc</p>
</div>
</div>
<div class="carousel-item">
<img src="img/gallery3.jpg" class="d-block w-100 gallery-img" alt="item">
<div class="carousel-caption">
<h5>item3</h5>
<p>desc</p>
</div>
</div>
<a class="carousel-control-prev" href="#gallery" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">prev</span>
</a>
<a class="carousel-control-next" href="#gallery" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">next</span>
</a>
</div>
</div>