How do you center text inside a card in bootstrap? [duplicate] - html

This question already has answers here:
Bootstrap Center Vertical and Horizontal Alignment
(17 answers)
Vertical Align Center in Bootstrap 4 [duplicate]
(20 answers)
Flexbox: center horizontally and vertically
(14 answers)
In CSS Flexbox, why are there no "justify-items" and "justify-self" properties?
(6 answers)
Closed 3 years ago.
I wrote a code for card in Bootstrap 4. Now I would like to center all the text that is inside the card but I can't find a way on how to do this.
I tried to "text-center" the entire section. I've also tried to use "d-flex" with justifying the content for the entire row/container which didn't work either.
Here's my code :
<section id="jobs">
<!--Employing cards-->
<div class="container-fluid container-fluid-shorter py-4 bg-white">
<!--Assistant card-->
<div class="row">
<div class="col-md-6 col-lg-4 my-3">
<div class="card">
<img src="images/assistant.jpg" alt="assistant" class="card-img-top">
<div class="card-body">
<h4 class="card-title text-capitalize">asistentka</h4>
<p class="card-text">
<h5 class="text-grey font-weight-light pb-3 pt-1">Do našeho kolektivu hledáme kolegyni na pozici asistentky. Možná hledáme právě vás!</h5>
<a href="assistant.html" class="btn btn-green mt-5">
<h6 class="btn-text text-white pt-1 px-4">Zjistit více</h6>
</a>
</div>
</div>
</div>
<div class="col-md-6 col-lg-4 my-3">
<div class="card">
<img src="images/developer.jpg" alt="developer" class="card-img-top">
<div class="card-body">
<h4 class="card-title text-capitalize">developer</h4>
<p class="card-text">
<h5 class="text-grey font-weight-light pb-3 pt-1">Hledáme kolegu/kolegyni na pozici IT Developer (databáze, aplikace, API, webové služby, apod.)</h5>
<a href="employerform.html" class="btn btn-green mt-5">
<h6 class="btn-text text-white pt-1 px-4">Zjistit více</h6>
</a>
</div>
</div>
</div>
<div class="col-md-6 col-lg-4 my-3 mx-auto">
<div class="card">
<img src="images/advertiser.jpg" alt="advertiser" class="card-img-top">
<div class="card-body">
<h4 class="card-title text-capitalize">obchodník</h4>
<p class="card-text">
<h5 class="text-grey font-weight-light pb-3 pt-1">Do naší firmy hledáme kolegu/kolegyni na pozici IT reklamy a obchodu.</h5>
<a href="employerform.html" class="btn btn-green mt-5">
<h6 class="btn-text text-white pt-1 px-4">Zjistit více</h6>
</a>
</div>
</div>
</div>
</div>
</div>
<!--End of employing cards section-->
</section>
.container-fluid-shorter{
max-width: 90rem;
}
What am I doing wrong? Thanks to anyone.

Is it something like this you are after? Using flex and then justify-content-center
.card-body {
flex-direction: column;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<section id="jobs">
<!--Employing cards-->
<div class="container-fluid container-fluid-shorter py-4 bg-white">
<!--Assistant card-->
<div class="row">
<div class="col-md-6 col-lg-4 my-3">
<div class="card">
<img src="images/assistant.jpg" alt="assistant" class="card-img-top">
<div class="card-body d-flex align-items-center justify-content-center">
<h4 class="card-title text-capitalize">asistentka</h4>
<p class="card-text">
<h5 class="text-grey font-weight-light pb-3 pt-1 text-center">Do našeho kolektivu hledáme kolegyni na pozici asistentky. Možná hledáme právě vás!</h5>
<a href="assistant.html" class="btn btn-green mt-5">
<h6 class="btn-text text-white pt-1 px-4">Zjistit více</h6>
</a>
</div>
</div>
</div>
<div class="col-md-6 col-lg-4 my-3">
<div class="card">
<img src="images/developer.jpg" alt="developer" class="card-img-top">
<div class="card-body d-flex align-items-center justify-content-center">
<h4 class="card-title text-capitalize">developer</h4>
<p class="card-text">
<h5 class="text-grey font-weight-light pb-3 pt-1 text-center">Hledáme kolegu/kolegyni na pozici IT Developer (databáze, aplikace, API, webové služby, apod.)</h5>
<a href="employerform.html" class="btn btn-green mt-5">
<h6 class="btn-text text-white pt-1 px-4">Zjistit více</h6>
</a>
</div>
</div>
</div>
<div class="col-md-6 col-lg-4 my-3 mx-auto">
<div class="card">
<img src="images/advertiser.jpg" alt="advertiser" class="card-img-top">
<div class="card-body d-flex align-items-center justify-content-center">
<h4 class="card-title text-capitalize">obchodník</h4>
<p class="card-text">
<h5 class="text-grey font-weight-light pb-3 pt-1 text-center">Do naší firmy hledáme kolegu/kolegyni na pozici IT reklamy a obchodu.</h5>
<a href="employerform.html" class="btn btn-green mt-5">
<h6 class="btn-text text-white pt-1 px-4">Zjistit více</h6>
</a>
</div>
</div>
</div>
</div>
</div>
<!--End of employing cards section-->
</section>

Related

Unwanted white space when I go into mobile view

Does someone know how to remove this white space?
This only occurs when I'm in mobile view.
Image of the problem. Untitled:
I tried using responsive instead of fluid but that doesn't solve the problem completely, the image is just scaled up.
HTML code of these boxes
<div class="row no-gutters">
<div class="col-6 d-flex align-items-center flex-column justify-content-center bg-dark">
<h2 class="mb-0 text-white">Za miran život bez stresa!</h2>
<br>
<p class="mb-0 text-white-50">321 GARAŽNO MESTO</p>
<p class="mb-0 text-white-50">+ priključci za električni automobil, auto-perionica u garaži.</p>
</div>
<div class="col-6">
<img src="assets/img/slikablok2.jpg" class="img-fluid">
</div>
</div>
<div class="row no-gutters">
<div class="col-6">
<img src="assets/img/slikablok3.jpg" class="img-fluid">
</div>
<div class="col-6 d-flex align-items-center flex-column justify-content-center bg-dark">
<h2 class="text-white"> SPOJITE SE SA PRIRODOM! </h2>
<br>
<p class="mb-0 text-white">Naša inspiracija – Gorica, simbol je magičnog lijepog parka koji se prostire
parkom površine od čak 1,4 hektara.</p>
<p class="mb-0 text-white">Njime poručujemo da se spojite sa prirodom, procvetate i napredujete.</p>
</div>
<div class="col-6 d-flex align-items-center flex-column justify-content-center bg-dark">
<h2 class="mb-0 text-white">Za sve vremenske prilike i potpuno uživanje.</h2>
<br>
<p class="mb-0 text-white-50">GRIJANJE I HLAĐENJE</p>
<p class="mb-0 text-white-50">U stambenom dijlu objekta primenjen je sistem grijanja i hlađenja svih prostorija, najsavremenijom tehnologijom.</p>
</div>
<div class="col-6">
<img src="assets/img/slikablok4.jpg" class="img-fluid">
</div>
</div>
replace your class img-fluid for w-100 h-100 and object-fit: cover in css
img {
object-fit: cover
}
<link href="https://cdn.jsdelivr.net/npm/bootstrap#4.6.1/dist/css/bootstrap.min.css" rel="stylesheet" />
<div class="row no-gutters">
<div class="col-6 d-flex align-items-center flex-column justify-content-center bg-dark">
<h2 class="mb-0 text-white">Za miran život bez stresa!</h2>
<br>
<p class="mb-0 text-white-50">321 GARAŽNO MESTO</p>
<p class="mb-0 text-white-50">+ priključci za električni automobil, auto-perionica u garaži.</p>
</div>
<div class="col-6">
<img src="https://picsum.photos/200/300?random=1" class="w-100 h-100">
</div>
</div>
<div class="row no-gutters">
<div class="col-6">
<img src="https://picsum.photos/200/300?random=2" class="w-100 h-100">
</div>
<div class="col-6 d-flex align-items-center flex-column justify-content-center bg-dark">
<h2 class="text-white"> SPOJITE SE SA PRIRODOM! </h2>
<br>
<p class="mb-0 text-white">Naša inspiracija – Gorica, simbol je magičnog lijepog parka koji se prostire parkom površine od čak 1,4 hektara.</p>
<p class="mb-0 text-white">Njime poručujemo da se spojite sa prirodom, procvetate i napredujete.</p>
</div>
<div class="col-6 d-flex align-items-center flex-column justify-content-center bg-dark">
<h2 class="mb-0 text-white">Za sve vremenske prilike i potpuno uživanje.</h2>
<br>
<p class="mb-0 text-white-50">GRIJANJE I HLAĐENJE</p>
<p class="mb-0 text-white-50">U stambenom dijlu objekta primenjen je sistem grijanja i hlađenja svih prostorija, najsavremenijom tehnologijom.</p>
</div>
<div class="col-6">
<img src="https://picsum.photos/200/300?random=3" class="w-100 h-100">
</div>
</div>

How to align div with proper space in between in bootstrap 4

How to align these 3 div with more margin?
i tried col-3, but still doesn't work for me, i want 1 div to be in left, 2nd in center, and 3rd in right. i tried using css for margin, but it's worse in responsive. do i need to do responsive part to?
Check this image, i want to make this..
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>General Announcement</title>
</head>
<body>
<section class="activities">
<div class="container">
<div class="row">
<div class="col-md-12">
<h3 class="text-center text-primary text-uppercase font-weight-bold mb-4">Upcoming activities for october 2019</h3>
</div>
<div class="col-md-3 mb-sm-5">
<img src="images/img-5.jpg" class="img-fluid">
<span class="d-block text-uppercase font-weight-bold mt-3">October 20</span>
<h4 class="text-uppercase font-weight-bold">Run for charity</h4>
More info
</div>
<div class="col-md-3 mb-sm-5">
<img src="images/img-6.jpg" class="img-fluid">
<span class="d-block text-uppercase font-weight-bold mt-3">October 11</span>
<h4 class="text-uppercase font-weight-bold">Book drive</h4>
More info
</div>
<div class="col-md-3">
<img src="images/img-7.jpg" class="img-fluid">
<span class="d-block text-uppercase font-weight-bold mt-3">October 21</span>
<h4 class="text-uppercase font-weight-bold">Recycling initiative</h4>
More info
</div>
</div>
</div>
</section>
</body>
</html>
Move the col-12 header part outside of what is now your row and change row to be a flex column. BS4 supports flex and it's the best way to go for this use case.
Here's a fiddle
<section class="activities">
<div class="container">
<div class="col-md-12">
<h3 class="text-center text-primary text-uppercase font-weight-bold mb-4">Upcoming activities for october 2019</h3>
</div>
<div class="d-flex justify-content-between">
<div class="col-md-3 mb-sm-5">
<img src="images/img-5.jpg" class="img-fluid">
<span class="d-block text-uppercase font-weight-bold mt-3">October 20</span>
<h4 class="text-uppercase font-weight-bold">Run for charity</h4>
More info
</div>
<div class="col-md-3 mb-sm-5">
<img src="images/img-6.jpg" class="img-fluid">
<span class="d-block text-uppercase font-weight-bold mt-3">October 11</span>
<h4 class="text-uppercase font-weight-bold">Book drive</h4>
More info
</div>
<div class="col-md-3">
<img src="images/img-7.jpg" class="img-fluid">
<span class="d-block text-uppercase font-weight-bold mt-3">October 21</span>
<h4 class="text-uppercase font-weight-bold">Recycling initiative</h4>
More info
</div>
</div>
</div>
</section>
You need to include Bootstrap css.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>General Announcement</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
</head>
<body>
<section class="activities">
<div class="container">
<div class="row justify-content-between">
<div class="col-md-12">
<h3 class="text-center text-primary text-uppercase font-weight-bold mb-4">Upcoming activities for
october 2019</h3>
</div>
<div class="col-md-3 mb-sm-5">
<img src="images/img-5.jpg" class="img-fluid">
<span class="d-block text-uppercase font-weight-bold mt-3">October 20</span>
<h4 class="text-uppercase font-weight-bold">Run for charity</h4>
More info
</div>
<div class="col-md-3 mb-sm-5">
<img src="images/img-6.jpg" class="img-fluid">
<span class="d-block text-uppercase font-weight-bold mt-3">October 11</span>
<h4 class="text-uppercase font-weight-bold">Book drive</h4>
More info
</div>
<div class="col-md-3">
<img src="images/img-7.jpg" class="img-fluid">
<span class="d-block text-uppercase font-weight-bold mt-3">October 21</span>
<h4 class="text-uppercase font-weight-bold">Recycling initiative</h4>
More info
</div>
</div>
</div>
</section>
</body>
</html>
try this I hope this will work :)

Spanning the title of a bootstrap 4 card group

I have a bootstrap card group with a title. Currently, the title is within a card, but I would like this to span over the card group. How can this be done?
<div class="card-group">
<div class="card border-right-0 border-top-0">
<div class="card-header bg-white border-bottom-0 h5 font-weight-light">Project Status Overview</div>
<div class="card-body">
<h1 class="card-text text-primary text-center">#ViewBag.ActiveProjects</h1>
<p class="card-title text-center font-weight-bold">Active Projects</p>
</div>
</div>
<div class="card border-right-0 border-top-0">
<div class="card-header bg-white border-bottom-0 h5 font-weight-light"> </div>
<div class="card-body">
<h1 class="card-text text-secondary text-center">#ViewBag.ArchivedProjects</h1>
<p class="card-title text-center font-weight-bold">Archived Projects</p>
</div>
</div>
<div class="card border-right-0 border-top-0">
<div class="card-header bg-white border-bottom-0 h5 font-weight-light"> </div>
<div class="card-body">
<h1 class="card-text text-warning text-center">3</h1>
<p class="card-title text-center font-weight-bold">Pending Dimensions</p>
</div>
</div>
<div class="card border-top-0">
<div class="card-header bg-white border-bottom-0 h5 font-weight-light"> </div>
<div class="card-body">
<h1 class="card-text text-success text-center">32</h1>
<p class="card-title text-center font-weight-bold">Estimates Available</p>
</div>
</div>
</div>
You can solve this by using Flex box. Wrap the .card-group div in a flex box div, and then move the title div outside the .card-group div.
Example
<div class="d-flex flex-column">
<div class="bg-white border-bottom-0 h5 font-weight-light">title</div>
<div class="card-group"><!-- cards here --></div>
</div>
When using display: flex; (.d-flex), the title div will align with the .card-group div.
Solution:
<div class="d-flex flex-column">
<div class="bg-white border-bottom-0 h5 font-weight-light">Project Status Overview</div>
<div class="card-group">
<div class="card border-right-0 border-top-0">
<div class="card-body">
<h1 class="card-text text-primary text-center">23</h1>
<p class="card-title text-center font-weight-bold">Active Projects</p>
</div>
</div>
<div class="card border-right-0 border-top-0">
<div class="card-body">
<h1 class="card-text text-secondary text-center">5</h1>
<p class="card-title text-center font-weight-bold">Archived Projects</p>
</div>
</div>
<div class="card border-right-0 border-top-0">
<div class="card-body">
<h1 class="card-text text-warning text-center">3</h1>
<p class="card-title text-center font-weight-bold">Pending Dimensions</p>
</div>
</div>
<div class="card border-top-0">
<div class="card-body">
<h1 class="card-text text-success text-center">32</h1>
<p class="card-title text-center font-weight-bold">Estimates Available</p>
</div>
</div>
</div>
</div>
Jsbin example here: https://jsbin.com/xeyiroyasa/edit?html,output

How do I fix this overflow problem without setting any height? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I have been working on this interface for few days using bootstrap4 and I cant get this one div to get a scrollbar without setting height in px's. Also a guide toward managing one page design?
Following is the link to the HTML code.
https://www.codeply.com/p/xm4bUOWFVh
To make an element within a flexbox state scrollable you can make a new container within the flexbox element and set to position: absolute;
Hopefully this helps. See my example below.
#chat-list {
position: relative;
overflow-y: scroll;
height: 100%;
}
.chat-scroll {
position: absolute;
top: 0;
left: 0;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
</head>
<body>
<div class="container border bg-success w-100" style="height: 95vh;">
<div class="row h-100">
<div class="col-md-12">
<h3>My Whatsapp</h3>
</div>
<div class="col-12 col-sm-5 col-md-4 d-flex flex-column border " id="chat-list-area" style="position:relative; ">
<!-- Navbar -->
<div class="row d-flex flex-row align-items-center p-2 bg-warning " id="navbar">
<div class="text-white font-weight-bold">My Chats</div>
<div class="nav-item dropdown ml-auto">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false"><i class="fas fa-ellipsis-v text-white"></i></a>
<div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item" href="#">New Group</a>
<a class="dropdown-item" href="#">Archived</a>
<a class="dropdown-item" href="#">Starred</a>
<a class="dropdown-item" href="#">Settings</a>
<a class="dropdown-item" href="#">Log Out</a>
</div>
</div>
</div>
<!-- Chat List -->
<div class="row" id="chat-list">
<!-- new container -->
<div class="chat-scroll">
<!-- new container -->
<div class="col-xs-12 w-100 bg-light">
<div class="chat-list-item d-flex flex-row w-100 p-2 border-bottom active" style="">
<div class="w-50">
<div class="name">Programmers</div>
<div class="small last-message">+91 98232 37261: yeah, i'm online</div>
</div>
<div class="flex-grow-1 text-right">
<div class="small time">28/03/2018</div>
<div class="badge badge-success badge-pill small d-none" id="unread-count">2</div>
</div>
</div>
<div class="chat-list-item d-flex flex-row w-100 p-2 border-bottom">
<div class="w-50">
<div class="name">Dee</div>
<div class="small last-message"><i class="fas fa-check-circle mr-1"></i> if you go to the movie, then give me a call</div>
</div>
<div class="flex-grow-1 text-right">
<div class="small time">27/03/2018</div>
</div>
</div>
<div class="chat-list-item d-flex flex-row w-100 p-2 border-bottom unread" onclick="">
<div class="w-50">
<div class="name">Jimmy</div>
<div class="small last-message"> have you seen infinity war?</div>
</div>
<div class="flex-grow-1 text-right">
<div class="small time">27/03/2018</div>
<div class="badge badge-success badge-pill small" id="unread-count">1</div>
</div>
</div>
<div class="chat-list-item d-flex flex-row w-100 p-2 border-bottom" onclick="">
<div class="w-50">
<div class="name">John</div>
<div class="small last-message"><i class="far fa-check-circle mr-1"></i> yup</div>
</div>
<div class="flex-grow-1 text-right">
<div class="small time">27/03/2018</div>
</div>
</div>
<div class="chat-list-item d-flex flex-row w-100 p-2 border-bottom" onclick=" ">
<div class="w-50">
<div class="name">Rob Mobile</div>
<div class="small last-message"><i class="far fa-check-circle mr-1"></i> i'm good too</div>
</div>
<div class="flex-grow-1 text-right">
<div class="small time">26/03/2018</div>
</div>
</div>
<div class="chat-list-item d-flex flex-row w-100 p-2 border-bottom" onclick=" ">
<div class="w-50">
<div class="name">Rob Mobile</div>
<div class="small last-message"><i class="far fa-check-circle mr-1"></i> i'm good too</div>
</div>
<div class="flex-grow-1 text-right">
<div class="small time">26/03/2018</div>
</div>
</div>
<div class="chat-list-item d-flex flex-row w-100 p-2 border-bottom" onclick=" ">
<div class="w-50">
<div class="name">Rob Mobile</div>
<div class="small last-message"><i class="far fa-check-circle mr-1"></i> i'm good too</div>
</div>
<div class="flex-grow-1 text-right">
<div class="small time">26/03/2018</div>
</div>
</div>
<div class="chat-list-item d-flex flex-row w-100 p-2 border-bottom" onclick=" ">
<div class="w-50">
<div class="name">Rob Mobile</div>
<div class="small last-message"><i class="far fa-check-circle mr-1"></i> i'm good too</div>
</div>
<div class="flex-grow-1 text-right">
<div class="small time">26/03/2018</div>
</div>
</div>
<div class="chat-list-item d-flex flex-row w-100 p-2 border-bottom" onclick=" ">
<div class="w-50">
<div class="name">Rob Mobile</div>
<div class="small last-message"><i class="far fa-check-circle mr-1"></i> i'm good too</div>
</div>
<div class="flex-grow-1 text-right">
<div class="small time">26/03/2018</div>
</div>
</div>
<div class="chat-list-item d-flex flex-row w-100 p-2 border-bottom" onclick=" ">
<div class="w-50">
<div class="name">Rob Mobile</div>
<div class="small last-message"><i class="far fa-check-circle mr-1"></i> i'm good too</div>
</div>
<div class="flex-grow-1 text-right">
<div class="small time">26/03/2018</div>
</div>
</div>
<div class="chat-list-item d-flex flex-row w-100 p-2 border-bottom" onclick=" ">
<div class="w-50">
<div class="name">Rob Mobile</div>
<div class="small last-message"><i class="far fa-check-circle mr-1"></i> i'm good too</div>
</div>
<div class="flex-grow-1 text-right">
<div class="small time">26/03/2018</div>
</div>
</div>
<div class="chat-list-item d-flex flex-row w-100 p-2 border-bottom" onclick=" ">
<div class="w-50">
<div class="name">Rob Mobile</div>
<div class="small last-message"><i class="far fa-check-circle mr-1"></i> i'm good too</div>
</div>
<div class="flex-grow-1 text-right">
<div class="small time">26/03/2018</div>
</div>
</div>
<div class="chat-list-item d-flex flex-row w-100 p-2 border-bottom" onclick=" ">
<div class="w-50">
<div class="name">Rob Mobile</div>
<div class="small last-message"><i class="far fa-check-circle mr-1"></i> i'm good too</div>
</div>
<div class="flex-grow-1 text-right">
<div class="small time">26/03/2018</div>
</div>
</div>
<div class="chat-list-item d-flex flex-row w-100 p-2 border-bottom" onclick=" ">
<div class="w-50">
<div class="name">Rob Mobile</div>
<div class="small last-message"><i class="far fa-check-circle mr-1"></i> i'm good too</div>
</div>
<div class="flex-grow-1 text-right">
<div class="small time">26/03/2018</div>
</div>
</div>
<div class="chat-list-item d-flex flex-row w-100 p-2 border-bottom" onclick=" ">
<div class="w-50">
<div class="name">Rob Mobile</div>
<div class="small last-message"><i class="far fa-check-circle mr-1"></i> i'm good too</div>
</div>
<div class="flex-grow-1 text-right">
<div class="small time">26/03/2018</div>
</div>
</div>
<div class="chat-list-item d-flex flex-row w-100 p-2 border-bottom" onclick=" ">
<div class="w-50">
<div class="name">Rob Mobile</div>
<div class="small last-message"><i class="far fa-check-circle mr-1"></i> i'm good too</div>
</div>
<div class="flex-grow-1 text-right">
<div class="small time">26/03/2018</div>
</div>
</div>
</div>
</div>
</div>
<!-- Profile Settings -->
</div>
<!-- Message Area -->
<div class="d-none d-sm-flex flex-column col-12 col-sm-7 col-md-8 p-0 " style="height: 95%;" id="message-area">
<!-- Navbar -->
<div class="row d-flex flex-row align-items-center p-2 m-0 w-100 border bg-primary" id="navbar">
<div class="d-block d-sm-none">
<i class="fas fa-arrow-left p-2 mr-2 text-white" style="font-size: 1.5rem; cursor: pointer;"></i>
</div>
<div class="d-flex flex-column">
<div class="text-white font-weight-bold" id="name">Programmers</div>
<div class="text-white small" id="details">You, Jimmy, Rob Mobile</div>
</div>
<div class="d-flex flex-row align-items-center ml-auto">
<i class="fas fa-search mx-3 text-white d-none d-md-block"></i>
<i class="fas fa-paperclip mx-3 text-white d-none d-md-block"></i>
<i class="fas fa-ellipsis-v mr-2 mx-sm-3 text-white"></i>
</div>
</div>
<!-- Messages -->
<div class="d-flex flex-column" id="messages" style="flex: 1!important;background: hsl(0, 0%, 80%);overflow: auto;">
<div class="mx-auto my-2 bg-primary text-white small py-1 px-2 rounded">
27/03/2018
</div>
<div class="align-self-start p-1 my-1 mx-3 rounded bg-white shadow-sm message-item">
<div class="options">
<i class="fas fa-angle-down text-muted px-2"></i>
</div>
<div class="small font-weight-bold text-primary">
+91 98232 63547
</div>
<div class="d-flex flex-row">
<div class="body m-1 mr-2">anyone online?</div>
<div class="time ml-auto small text-right flex-shrink-0 align-self-end text-muted" style="width:75px;">
18:20
</div>
</div>
</div>
<div class="mx-auto my-2 bg-primary text-white small py-1 px-2 rounded">
28/03/2018
</div>
<div class="align-self-start p-1 my-1 mx-3 rounded bg-white shadow-sm message-item">
<div class="options">
<i class="fas fa-angle-down text-muted px-2"></i>
</div>
<div class="small font-weight-bold text-primary">
+91 98232 37261
</div>
<div class="d-flex flex-row">
<div class="body m-1 mr-2">yeah, i'm online</div>
<div class="time ml-auto small text-right flex-shrink-0 align-self-end text-muted" style="width:75px;">
17:10
</div>
</div>
</div>
</div>
<!-- Input -->
<div class="justify-self-end align-items-center flex-row d-flex" id="input-area">
<i class="far fa-smile text-muted px-3" style="font-size:1.5rem;"></i>
<input type="text" name="message" id="input" placeholder="Type a message" class="flex-grow-1 border-0 px-3 py-2 my-3 rounded shadow-sm">
<i class="fas fa-paper-plane text-muted px-3" style="cursor:pointer;" onclick="sendMessage()"></i>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
</body>
</html>

Colums won't inline with each other in .card class

I'm trying to make cards inline next to each other in columns but they keep jumping under each other. I can't figure out why that happens even when I set col-md-6 so two of them should align next to each other.
I've checked for any issues with my columns and if they are right. I've also tried setting different column sizes so they count 12. That didn't work as well. I also couldn't fix the container issue. I need to know what I've done wrong so I can fix it on my own next time. Thanks for any help.
<section id="jobs" class="py-5 bg-white">
<div class="container">
<div class="row">
<div class="col text-center">
<h1 class="display-3 text-uppercase text-black mb-0">pozice</h1>
<div class="underline-green bg-green"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 col-lg-4 my-3">
<div class="card">
<img src="images/assistant.jpg" alt="assistant" class="card-img-top">
<div class="card-body">
<h4 class="card-title text-capitalize">asistentka</h4>
<p class="card-text">
<h5 class="text-grey font-weight-light pb-3 pt-1">Do našeho kolektivu hledáme kolegyni na pozici asistentky. Možná hledáme právě vás!</h5>
<a href="" class="btn btn-green mt-5">
<h6 class="btn-text text-white pt-1 px-4">Zjistit více</h6>
</a>
</p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 col-lg-4 my-3">
<div class="card">
<img src="images/developer.jpg" alt="developer" class="card-img-top">
<div class="card-body">
<h4 class="card-title text-capitalize">developer</h4>
<p class="card-text">
<h5 class="text-grey font-weight-light pb-3 pt-1">Do našeho kolektivu hledáme kolegyni na pozici asistentky. Možná hledáme právě vás!</h5>
<a href="" class="btn btn-green mt-5">
<h6 class="btn-text text-white pt-1 px-4">Zjistit více</h6>
</a>
</p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 col-lg-4 my-3">
<div class="card">
<img src="images/advertiser.jpg" alt="advertiser" class="card-img-top">
<div class="card-body">
<h4 class="card-title text-capitalize">obchodník</h4>
<p class="card-text">
<h5 class="text-grey font-weight-light pb-3 pt-1">Do našeho kolektivu hledáme kolegyni na pozici asistentky. Možná hledáme právě vás!</h5>
<a href="" class="btn btn-green mt-5">
<h6 class="btn-text text-white pt-1 px-4">Zjistit více</h6>
</a>
</p>
</div>
</div>
</div>
</div>
</section>
you have to put all column in the same row
<section id="jobs" class="py-5 bg-white">
<div class="container">
<div class="row">
<div class="col text-center">
<h1 class="display-3 text-uppercase text-black mb-0">pozice</h1>
<div class="underline-green bg-green"></div>
</div>
</div>
<div class="row">
<div class="col-md-6 col-lg-4 my-3">
<div class="card">
<img src="images/assistant.jpg" alt="assistant" class="card-img-top">
<div class="card-body">
<h4 class="card-title text-capitalize">asistentka</h4>
<p class="card-text">
<h5 class="text-grey font-weight-light pb-3 pt-1">Do našeho kolektivu hledáme kolegyni na pozici asistentky. Možná hledáme právě vás!</h5>
<a href="" class="btn btn-green mt-5">
<h6 class="btn-text text-white pt-1 px-4">Zjistit více</h6>
</a>
</div>
</div>
</div>
<div class="col-md-6 col-lg-4 my-3">
<div class="card">
<img src="images/developer.jpg" alt="developer" class="card-img-top">
<div class="card-body">
<h4 class="card-title text-capitalize">developer</h4>
<p class="card-text">
<h5 class="text-grey font-weight-light pb-3 pt-1">Do našeho kolektivu hledáme kolegyni na pozici asistentky. Možná hledáme právě vás!</h5>
<a href="" class="btn btn-green mt-5">
<h6 class="btn-text text-white pt-1 px-4">Zjistit více</h6>
</a>
</div>
</div>
</div>
<div class="col-md-6 col-lg-4 my-3">
<div class="card">
<img src="images/advertiser.jpg" alt="advertiser" class="card-img-top">
<div class="card-body">
<h4 class="card-title text-capitalize">obchodník</h4>
<p class="card-text">
<h5 class="text-grey font-weight-light pb-3 pt-1">Do našeho kolektivu hledáme kolegyni na pozici asistentky. Možná hledáme právě vás!</h5>
<a href="" class="btn btn-green mt-5">
<h6 class="btn-text text-white pt-1 px-4">Zjistit více</h6>
</a>
</div>
</div>
</div>
</div>
</div>
</section>
If you want to display your card inline. You should put it in a same row instead of putting each card in a row.
<div className="row">
<div className="col-md-6 col-lg-4 my-3">
<div className="card">
<img src="images/assistant.jpg" alt="assistant" className="card-img-top">
<div className="card-body">
<h4 className="card-title text-capitalize">asistentka</h4>
<p className="card-text">
<h5 className="text-grey font-weight-light pb-3 pt-1">Do našeho kolektivu hledáme kolegyni na pozici asistentky. Možná hledáme právě vás!</h5>
<a href="" className="btn btn-green mt-5">
<h6 className="btn-text text-white pt-1 px-4">Zjistit více</h6>
</a>
</p>
</div>
</div>
</div>
<div className="col-md-6 col-lg-4 my-3">
<div className="card">
<img src="images/developer.jpg" alt="developer" className="card-img-top">
<div className="card-body">
<h4 className="card-title text-capitalize">developer</h4>
<p className="card-text">
<h5 className="text-grey font-weight-light pb-3 pt-1">Do našeho kolektivu hledáme kolegyni na pozici asistentky. Možná hledáme právě vás!</h5>
<a href="" className="btn btn-green mt-5">
<h6 className="btn-text text-white pt-1 px-4">Zjistit více</h6>
</a>
</p>
</div>
</div>
</div>
<div className="col-md-6 col-lg-4 my-3">
<div className="card">
<img src="images/advertiser.jpg" alt="advertiser" className="card-img-top">
<div className="card-body">
<h4 className="card-title text-capitalize">obchodník</h4>
<p className="card-text">
<h5 className="text-grey font-weight-light pb-3 pt-1">Do našeho kolektivu hledáme kolegyni na pozici asistentky. Možná hledáme právě vás!</h5>
<a href="" className="btn btn-green mt-5">
<h6 className="btn-text text-white pt-1 px-4">Zjistit více</h6>
</a>
</p>
</div>
</div>
</div>
</div>