Reputation: 13
Wanting to stack the contents of each slide (an h2 and button) vertically instead of the default inline format of Bootstrap 4 Carousel. My code is as follows:
<div id="slider" class="carousel slide" data-ride="carousel">
<div class="carousel-inner" role="listbox">
<div class="carousel-item active" style="background-image: url({{ 'placeholder1.jpg' | asset_url }})">
<div class="d-flex h-100 align-items-center justify-content-center">
<h2>Great food without the price</h2>
<button class="btn btn-primary btn-lg">Order now</button>
</div>
</div>
...
</div>
</div>
This is my first time using version 4 so a little fresh on use of d-flex etc. Any help would be appreciated :)
Upvotes: 1
Views: 882
Reputation: 1239
You need to add .flex-column
to your .d-flex
div. But also need to put some <br>
tag inside <h2>
as to seperate the text into two lines.
Upvotes: 1