How to fix responsive problem in Bootstrap 4 - html

I am using Bootstrap 4 and I have the following jumbotron class:
.rounded-circle{
vertical-align: left;
width: 100px;
height: 100px;
border-radius: 50%;
position: absolute;
left: -150px;
top: -50px;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<div class="jumbotron rounded-0">
<div class="container">
<div class="row">
<div class="col-md-4">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/a/a0/Circle_-_black_simple.svg/500px-Circle_-_black_simple.svg.png" alt="..." class="rounded-circle">
</div>
<div class="col-md-8">
this is mobile way of the container and other line
</div>
</div>
</div>
</div>
With this syntax, my desktop view is displaying as well following,
https://i.stack.imgur.com/mUrAe.png
but in my mobile view, it is not displaying in correct position as following https://i.stack.imgur.com/SaRuW.png
then how could I view my image and descriptions on all devices (desktop, tab and phone) as well, I need in the small device top image and then description under the image.
edited image

It's wrong here to use position: absolute with col, flex-box gives you the utility to make the behavior you are trying to reach without position: absolute,
First add the class align-items-center beside class row (this will align center vertically)
Second add the class col-12 to the columns (make the description below the image for smaller size)
Then optionally, you can add the classes text-center and text-md-left (on bigger sizes it will align left and on smaller it will be center)
.rounded-circle{
width: 100px;
height: 100px;
border-radius: 50%;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<div class="jumbotron rounded-0">
<div class="container">
<div class="row align-items-center text-center text-md-left">
<div class="col-12 col-md-4">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/a/a0/Circle_-_black_simple.svg/500px-Circle_-_black_simple.svg.png" alt="..." class="rounded-circle">
</div>
<div class="col-12 col-md-8">
this is mobile way of the container and other line
</div>
</div>
</div>
</div>

Related

Bootstrap and HTML: how to get first row content centered as full width and second row centered using a 50/50 split

I'd like to be able to get a layout using Bootstrap that looks as follows:
My code is:
<div class="container">
<div class="row">
<div class="col-12">foo</div>
</div>
<div class="row">
<div class="col-6">bar</div>
<div class="col-6">baz</div>
</div>
Unfortunately, I'm getting something that looks like this (notice that "foo" in row 1 is aligned with "bar" in row 2):
How do I achieve the desired result?
Thanks!
It seems you want to only center the text on the .col-12 from the first .row which you can easily achieve by simply adding the text-center class to that .col-12 element.
Note: the class text-center is a Bootstrap class.
/** just to visually show the changes */
.col-6,
.col-12 {
border: 1px solid red
}
.col-12 {
margin-bottom: 20px;
}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap#4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<div class="container">
<div class="row">
<div class="col-12 text-center">foo</div>
</div>
<div class="row">
<div class="col-6">bar</div>
<div class="col-6">baz</div>
</div>
</div>
In case you have an img not a text on the .col-12 element, you might simply add the d-inline-block and your image should be centered thanks to text-ce,ter class that we already applied.
/** just to visually show the changes */
.col-6,
.col-12 {
border: 1px solid red;
}
.col-12 {
margin-bottom: 20px;
}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap#4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<div class="container">
<div class="row">
<div class="col-12 text-center">
<img src="https://via.placeholder.com/150" width="150" class="img-fluid d-inline-block">
</div>
</div>
<div class="row">
<div class="col-6">bar</div>
<div class="col-6">baz</div>
</div>
</div>
Note: the use of d-inline-block is not really required but i used it to ensure cross-browser behavior because each browser might treat the images in a different way. Most of the browsers already set the display property of an image to inline-block.
The class img-fluid is a Bootstrap class that allows to maintain a responsive image. Learn more about Bootstrap Responsive Images on Bootstrap Docs (BS v4.0).
Learn more about the display property on MDN.
According to your code to make it center, you can align the text center and that's all.
<div class="container">
<div class="row text-center">
<div class="col-12">foo</div>
</div>
<div class="row text-center">
<div class="col-6">bar</div>
<div class="col-6">baz</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-12 text-center">foo</div>
</div>
<div class="row">
<div class="col-6">bar</div>
<div class="col-6">baz</div>
</div>

Why arent my divs centering in parent row when using bootstrap?

So I'm trying to center my green divs vertically which are the ones with the class myCol by using align-items-center on the parent row but it's not centering it and I have no idea why.
Why does it behave like that?
.myRow {
height: 30vh;
border: orange dotted 2px;
}
.myCell {
width: 100px;
height: 100px;
background: green;
border: blue dotted 3px;
}
<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet"/>
<div class="container">
<div class="row align-items-center myRow">
<div class="col-3 myCell">
</div>
</div>
<div class="row myRow">
<div class="col-4 myCell">
</div>
</div>
</div>
The problem with your code is that you are using Bootstrap version 2 whereas you should be using Bootstrap version 4.
Just replace the links for bootstrap script and css file and it should work.
You are using bootstrap version 2, but align-items-center class appear in bootstrap version 4.
Replace your html code to:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<div class="container">
<div class="row align-items-center myRow">
<div class="col-3 myCell">
</div>
</div>
<div class="row myRow">
<div class="col-4 myCell">
</div>
</div>
</div>

center align (V & H) a div with an img in a parent div?

I would like to align both an image and a div (horizontally and vertically centerd) inside parent div, but I can not, I have been trying to do it for 2 days. I am using bootstrap 4, HTML5, CSS3
Images somehow do not show in the code snippet
<!-- Welcome Area -->
<div class="container-fluid p-0">
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12 col-xl-12" style="background-image: url(assets/images/main-img.jpg);">
<div class="col-sm-12 col-md-12 col-lg-12 col-xl-12 text-center">
<img src="assets/images/auscene-icon-buttons-12-t.png" class="img-responsive img-fluid" id="welcome-area-img" style="visibility: hidden;" />
</div>
</div>
</div>
</div>
<!-- End Welcome Area -->
<!-- Main area -->
<div class="container-fluid">
<div class="row pt-4 pb-4 mb-5 px-0">
<div class="col-sm-2 col-md-1 col-lg-1 col-xl-1 px-0 text-center" style="width: 10% !important;" id="show-last-news-title">
<img src="assets/images/auscene_icon_button_01_Y9u_icon.ico" class="img-responsive img-fluid pt-4" id="auscene-image-1">
</div>
<div class="col-sm-2 col-md-1 col-lg-1 col-xl-1 px-0 text-center" style="width: 10% !important;" id="show-last-how-to-title">
<img src="assets/images/auscene_icon_button_02_xYm_icon.ico" class="img-responsive img-fluid pt-4" id="auscene-image-2">
</div>
<div class="col-sm-4 col-md-8 col-md-push-8 col-lg-8 col-xl-8 px-0" style="width: 60% !important;">
<h1 class="text-left" style="font-size:3.5rem; color:#5acfc2; font-family:LouisGeorgeCafe;" id="welcome-area-title">Issue #01
</h1>
<h1 class="text-left" style="font-size:2rem; font-family:LouisGeorgeCafe;" id="welcome-area-subtitle"></h1>
</div>
<div class="col-sm-2 col-md-1 col-lg-1 col-xl-1 px-0 text-center" style="width: 10% !important;" id="show-last-guide-to-aucians-title">
<img src="assets/images/auscene_icon_button_03_ClJ_icon.ico" class="img-responsive img-fluid pt-4" id="auscene-image-3">
</div>
<div class="col-sm-2 col-md-1 col-lg-1 col-xl-1 px-0 text-center" style="width: 10% !important;" id="show-last-in-depth-title">
<img src="assets/images/auscene_icon_button_04_JP2_icon.ico" class="img-responsive img-fluid pt-4" id="auscene-image-4">
</div>
</div>
</div>
<!-- End of Main area -->
Updated After solving the problem of not being able to align an image dead center overlaps the another, now the div takes automatically height of 20px instead of div background image's height
Below you find the desired effect by use of latest Bootstrap and additional styling. Please note that this also rectifies the inconsistencies you have in your code example with the proper headers, image links and bootstrap classes.
I have placed styling inline but you can move these to a separate file if you want.
The container is set to 100% of the view height in order to center the large image (the containing row) vertically.
The smaller image is vertically aligned by the calc function where we place the image 50% minus half the image height absolutely from the top (you'll have to take this into consideration if you add the #media ref below).
Please note that both images are responsive but since the smaller image maintains its original size for longer before resizing it looks like it's bigger than the background image on smaller devices.
You can alter this with the #media rule or with more advanced CSS but that's outside of the scope of your question.
(Consider using a background image instead as Ng-Sek-Long suggests)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Centered images</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
</head>
<body>
<!-- Welcome area -->
<div class="container-fluid d-flex justify-content-center align-items-center" style="min-height: 100vh;">
<div class="row">
<div class="col-xs-12" style="position: relative;">
<img src="https://www.gruberreisen.at/fileadmin/redakteure/Website/slider/Header_Startseite1.jpg" class="img-fluid" />
<div style="position: absolute; left: 0; top: calc(50% - 132px); width: 100%; text-align: center;">
<img src="http://placehold.it/269x265/ccc.jpg" class="img-fluid" />
</div>
</div>
</div>
</div>
</body>
</html>
See the code snippet below for an example:
.container {
position: relative;
display: inline-block;
vertical-align: middle;
width: 350px;
height: 250px;
}
.img-responsive {
box-sizing: border-box;
width: 350px;
height: 250px;
border-radius: #field-border-radius;
}
.overlay {
position: absolute;
top: 25%;
left: 25%;
}
.icon {
width: 175px;
height: 125px;
object-fit: fill;
}
<!-- Welcome Area -->
<div class="container-fluid p-0">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12 container">
<img src="https://www.gstatic.com/webp/gallery/4.sm.jpg" class="img-responsive img-fluid" />
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12 text-center overlay">
<img src="https://via.placeholder.com/175x125" class="img-responsive img-fluid icon" />
</div>
</div>
</div>
</div>
<!-- End Welcome Area -->
If you are looking for to align the both div and img to center you can add text-center to the parent element as well as to align left add text-left and for right text-right. But since you are having bootstrap col in your div it will have the padding when you set right or left. You need to write padding-left:0 or padding-right:0 according to the alignment.
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" />
<!-- Welcome Area -->
<div class="container-fluid p-0">
<div class="row">
<div class=" col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12 text-center">
<img src="https://source.unsplash.com/300x300" class="img-responsive img-fluid" />
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12 ">
<img src="https://source.unsplash.com/300x300?x" class="img-responsive img-fluid" style="z-index: auto;" />
</div>
</div>
</div>
</div>
If you are looking for them to keep in both side next to one , you need to change your HTML DOM like this.
col-**-12 which means takes the width:100%. If you want your child next to one your to give each child a 50% of the width. So you need to change it it col-**-6 which gives the 50% of width.According to the logic now your parent is row and it has 2 div elements which are childs and having col-**-6 for both. And inside they have the img. If you feel the padding is unnecessary to you, so you can add padding: 0 !important; margin: 0 !important; to the element who have the class col-**
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" />
<!-- Welcome Area -->
<div class="container-fluid p-0">
<div class="row">
<div class=" col-xs-6 col-sm-6 col-md-6 col-lg-6 col-xl-6 parent">
<img src="https://source.unsplash.com/300x300" class="img-responsive img-fluid" />
</div>
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6 col-xl-6 ">
<img src="https://source.unsplash.com/300x300?x" class="img-responsive img-fluid" style="z-index: auto;" />
</div>
</div>
</div>
In order to keep your img inside the larger one you need to set the element to position:absolute which make your element to non identifiable by html. Now you can position it as you wanted.
.parent {
position: relative;
}
.parent>img {
height: 530px;
width: 1820px;
object-fit: cover;
}
.inner-child {
position: absolute !important;
top: 50%;
-webkit-transform: translateY(-50%);
-moz-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
text-align: center;
}
.inner-child>img {
height: 269px;
width: 259px;
box-shadow: 0 0 5px 3px black;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" />
<!-- Welcome Area -->
<div class="container-fluid p-0">
<div class="row">
<div class=" col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12 parent">
<img src="https://source.unsplash.com/300x300" class="img-responsive img-fluid" />
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12 inner-child">
<img src="https://source.unsplash.com/300x300?x" class="img-responsive img-fluid" style="z-index: auto;" />
</div>
</div>
</div>
</div>
From your comment:
Image 1 in parent div will be 1820px X 530px (or more in width) image 2 - inside inner div- is 269px X 259px,
Seems like this is what you want, a simple css will be much better than trying to use bootstrap to do the job.
.outter-div {
width: 1820px;
height: 530px;
background-image: url("https://source.unsplash.com/collection/190727/1820x530");
}
.inner-img {
position: relative;
transform: translate(-50%, -50%);
top: 50%;
left: 50%;
}
<div class="outter-div">
<img class="inner-img" src="https://source.unsplash.com/collection/190727/269x259">
</div>
You only need to use:
.v-center {
top:50%;
left:0;
right:0;
transform: translateY(-50%);
}
The rest of the positioning can be done with Bootstrap classes.
<div class="container-fluid">
<div class="row no-gutters mvh-100 align-items-center">
<div class="col-12">
<img src="http://placehold.it/1860x530" class="img-fluid">
<div class="text-center position-absolute v-center">
<img src="http://placehold.it/269x265/444" class="img-fluid" style="z-index: auto;">
</div>
</div>
</div>
</div>
Demo: https://www.codeply.com/go/umBZgxLzEN
Note: Make sure you follow the Bootstrap docs. The -xs infix no longer exist, and there shouldn't be col directly in other col.

How can I change div's position when resizing?

I have a problem, all I want to do is at a certain width (using the #media) I want to change my left div to the right side under the one that is already there. I tried everything, including changing the display, positioning using left margin but due to the parent container it doesn't work. The only thing that I thought about is to make the same left div on the right side and to make the display to none, but I am pretty sure that's not the way to deal with it. I use Bootstrap 4.
This is the HTML:
.main{
background-color: #aaa;
box-shadow: 3px 3px 20px #000000;
border-radius: 20px;
margin-left: 20px;
margin-right: 20px
}
.left{
background-color: #aaa;
max-width: 200px;
height: 1%;
border-radius: 20px;
}
.right{
background-color: #aaa;
max-width: 200px;
height: 1%;
border-radius: 20px;
}
.right-content{
width: 100%;
text-align: center;
float: center;
margin-top: 10px;
}
.parent-container {
display: flex;
}
<div class="parent-container">
<div class="container left">
<div class="row">
Left content
</div>
</div>
<div class="container card main py-3">
<div class="container card">
<div class="card-body">
<div class="row">
<div class="col-lg-12 text-center">
<h2>TITLE2</h2>
</div>
</div>
<div class="row">
<div class="col-md-12 text-center">
<a href="#" class="link1">
<img src="2.jpg">
<h3>Title3</h3>
</a>
</div>
</div>
</div>
</div>
<div class="container right">
<div class="row">
<div class="right-content">
Right content here
</div>
</div>
</div>
</div>
To achieve the effect you want, you need to use Bootstrap 4 order-* classes. order-last in the code snippet below re-orders the column to come last by default but the order-md-first makes the column appear first on screens that are medium (md) or larger.
There are other ways of using the order classes to achieve the same result. This is just one of the possible options.
But there are many other and fundamental mistakes in your code. Here are a few pointers:
Do NOT nest containers inside other containers. Nest row-column pairs inside columns instead
Do NOT put any content directly into a .row. Bootstrap rows aren't designed for that. Put one or more columns (.col-*) into a row and put all your content inside that column(s).
Bootstrap 4 is flexbox-based by default and has classes to do almost everything you'll ever need in terms of positioning and spacing. Use those native Bootstrap classes instead of unnecessary custom css hacks.
Here's a working code snippet (click the "run code snippet" button below and expand to full page):
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<div class="container-fluid">
<div class="row">
<div class="col-12 col-md-3 col-xl-2 bg-light order-last order-md-first py-3">
Left div content <br>
Left div content <br>
Left div content <br>
</div>
<div class="col-12 col-md-9 col-xl-10 bg-primary py-3">
<div class="card py-3">
<div class="card-body">
<div class="row">
<div class="col text-center">
<h2>Right div TITLE</h2>
</div>
</div>
<div class="row">
<div class="col text-center">
<a href="#">
<img class="img-fluid" src="https://placeimg.com/888/88/tech">
<h3>Right div subtitle</h3>
</a>
</div>
</div>
</div>
<div class="row">
<div class="col text-center">
Right div content here
</div>
</div>
</div>
</div>
</div>
</div>
Notice: That code doesn't contain any of your custom css. If you want to add some custom css to that, start adding it line by line to see where your custom css breaks Bootstrap.
Also, the background classes bg-light and bg-primary in the code snippet above are just for making things easier to see.

How to align div to bottom inside div with Bootstrap?

html, body, .sidebar-container, .sidebar-row {
height: 100%;
}
.sidebar {
background-color: #2C3544;
}
#media (min-width: 992px) {
.sidebar {
position: fixed;
top: 0;
left: 0;
bottom: 0;
z-index: 1000;
display: block;
background-color: #2C3544;
}
}
img{
margin: auto;
display: block;
}
.sidebar-image{
margin-top: 15px;
}
.sidebar-items{
margin-top: 15px;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container-fluid sidebar-container">
<div class="row sidebar-row">
<div class="col-md-2 sidebar">
<div class="container-fluid">
<div class="col-md-12 sidebar-image">
<img src="assets/logo-white.png" width="75px" height="75px"/>
</div>
</div>
<div class="row sidebar-items">
<div class="col-md-12">
<ul class="list-group">
<li class="list-group-item">Dashboard</li>
<li class="list-group-item">Projects</li>
<li class="list-group-item">Statistics</li>
</ul>
</div>
</div>
<div class="row align-bottom">
hafldjalfjsdlfsjdlfsjlfs
</div>
</div>
<div class="col-md-10 offset-md-2 content">
Main Content
</div>
</div>
</div>
I wrote this HTML/CSS code trying to align a div to the bottom inside another div:
I want to align this last div in the col-md-2 to the bottom of the sidebar-container which height is 100%. I tried adding the bootstrap class align-bottom but somehow this doesn't work. Could anyone help me out?
Suppose you have 2 divs. Div A(Outer) and Div B(Inner). To achieve your task just place Div B code in Div A code and in Div B css class add this
position : absolute
bottom : 0
You can also just use bootstrap flexbox to do this.
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
<div class="d-flex align-items-start flex-column bg-success" style="height: 200px;">
<div class="mb-auto p-2">Flex item-1</div>
<div class="p-2">Flex item-2</div>
<div class="p-2">Flex item-3</div>
</div>
<div class="d-flex align-items-end flex-column bg-info" style="height: 200px;">
<div class="p-2">Flex item-a</div>
<div class="p-2">Flex item-b</div>
<div class="mt-auto p-2">Flex item-c</div>
</div>
align items to the left or right make sure that you include the entire d-flex align-items-end flex-column on the parent element and choose start or end depending if you want it to be aligned left or right.
align item to the bottom Then, use mt-auto on the div that you want to stick to the bottom of the parent.
When using Bootstrap grid system, my go-to solution is like this:
add d-flex to each col-*
add d-flex flex-column to each card-body
add mt-auto mx-auto to the last element (or last div of elements) I want to stick to the end
This prevents any further styling mess-up in my opinion.
Relevant Documentation:
Flex Alignment in Bootstrap 5.0: https://getbootstrap.com/docs/5.0/utilities/flex/#align-items
Vertical Alignment in Bootstrap 5.0: https://getbootstrap.com/docs/5.0/utilities/vertical-align/
Relevant Code:
What worked for me to align a div (of text) at the bottom of a row/container
<div class="d-flex align-content-end flex-wrap mb-2">
<span class="display-4 fw-bold text-black text-start mt-0 mb-0">Active Mural Projects</span>
</div>