I am trying to display three cards side by side, with the orange part containing the icon always at the bottom. How can I achieve this without using redundant classes?
I attempted to use align-items-end
, but it did not work as expected.
The goal is to only use Bootstrap classes for the solution.
For detailed code and an example check out this Fiddle:
@import url("https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="23414c4c57505751425363160d130d12">[email protected]</a>/dist/css/bootstrap.min.css");
@import url("https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="eb8984849f989f998a9bc68288848598abdac5d2c5da">[email protected]</a>/font/bootstrap-icons.css");
.coolspan {
background-color: #a71a0b !important;
color: #fff !important;
}
<h2 class="text-center">Title</h2>
<div class="row justify-content-center d-flex">
<div class="m-3 py-3 col-xl-3 col-lg-4 col-md-6 col-sm-6 col-xs-12 justify-content-center border rounded-2 border-dark flex-column position-relative">
<div class="d-flex">
<img class="img-fluid" src="https://mdbcdn.b-cdn.net/img/new/slides/041.jpg">
</div>
<div>
<p>
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
</p>
</div>
<div class="d-flex justify-content-center coolspan rounded-2 shadow align-items-end">
<i class="bi bi-person-circle big-icon"></i>
</div>
</div>
<div class="m-3 py-3 col-xl-3 col-lg-4 col-md-6 col-sm-6 col-xs-12 justify-content-center border rounded-2 border-dark flex-column position-relative">
<div class="d-flex ">
<img class="img-fluid" src="https://mdbcdn.b-cdn.net/img/new/slides/041.jpg">
</div>
<div>
<p>
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." "Lorem ipsum dolor sit amet, consectetur adipiscing
elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
</p>
</div>
<div class="d-flex justify-content-center coolspan rounded-2 shadow align-items-end">
<i class="bi bi-person-circle big-icon"></i>
</div>
</div>
<div class="m-3 py-3 col-xl-3 col-lg-4 col-md-6 col-sm-6 col-xs-12 justify-content-center border rounded-2 border-dark flex-column position-relative">
<div class="d-flex ">
<img class="img-fluid" src="https://mdbcdn.b-cdn.net/img/new/slides/041.jpg">
</div>
<div>
<p>
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." "Lorem ipsum dolor sit amet, consectetur adipiscing
elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
</p>
</div>
<div class="d-flex justify-content-center coolspan rounded-2 shadow align-items-end">
<i class="bi bi-person-circle big-icon"></i>
</div>
</div>