Reputation: 81
I'm trying to figure if this design is possible with the Bootstrap 4 carousel.
Essentially i'm looking to make a slider like in the above image but I can't figure out if it's possible to have the text on the left and the image on the right with the arrows.
Is this possible?
Any help is much appreciated.
I just have the default Bootstrap 4 carousel code at the moment.
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
<img class="d-block w-100" src="..." alt="First slide">
</div>
<div class="carousel-item">
<img class="d-block w-100" src="..." alt="Second slide">
</div>
<div class="carousel-item">
<img class="d-block w-100" src="..." alt="Third slide">
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleIndicators" 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="#carouselExampleIndicators" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
Upvotes: 2
Views: 9566
Reputation: 362610
Use the Bootstrap grid. For example 2 columns...
<div id="carouselExampleControls" class="carousel slide" data-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
<div class="row align-items-center">
<div class="col-md py-2">
<p> Text text text here. Text here, here, here, here is the text. Text here, here, here, here is the text. </p>
<button class="btn btn-primary">More here</button>
</div>
<div class="col-md py-2">
<img class="d-block img-fluid" src="..." alt="First slide">
</div>
</div>
</div>
<div class="carousel-item">
...
</div>
<div class="carousel-item">
...
</div>
</div>
</div>
Upvotes: 3