How to place an img behind a card and make it responsive - html

I would like to put an image behind a card and make it responsive
Quite useless to share my code because i really don't know where to go with this problem.
I already tried to put the img in a :after or :before but i could't manage to make it not break the display:flex of the card container, i tried to put it in the card using z-index but it creates a blank space before the text.
So i tried to schematize what i would like to do, thanks a lot! :)
Ugly drawing of what i want :D

you can use position relative to the parent and position absolute to the image which you want to place behind and adjust the top and bottom values
Codepen
.main-row>div{
background-color: #ffd5ff;
border-radius: 24px;
}
.main-row p::first-letter {
color: red;
font-size: xx-large;
}
.main-row .smily {
position:absolute;
top:-35px;
left:-35px;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/css/bootstrap.min.css">
<div class="container">
<div class="row main-row d-flex text-justify mt-5 d-flex justify-content-between position-relative">
<img src="https://pngimg.com/uploads/smiley/smiley_PNG155.png" style="height:60px; width:auto;" class="smily">
<div class="col-lg-3 para1 p-4 shadow mb-4">
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Facere, rem ratione deserunt necessitatibus ducimus excepturi quisquam hic, eum esse dignissimos laboriosam assumenda sapiente voluptas fugiat nulla inventore repellat consequuntur quasi?
Soluta mollitia voluptatibus molestiae, magnam rerum accusamus veritatis minima totam veniam! Incidunt ratione cupiditate quia aspernatur excepturi sit dolorum, fugit harum officia hic quam beatae itaque pariatur atque! Deserunt, provident.</p></div>
<div class="col-lg-3 para2 p-4 shadow mb-4"><p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Facere, rem ratione deserunt necessitatibus ducimus excepturi quisquam hic, eum esse dignissimos laboriosam assumenda sapiente voluptas fugiat nulla inventore repellat consequuntur quasi?
Soluta mollitia voluptatibus molestiae, magnam rerum accusamus veritatis minima totam veniam! Incidunt ratione cupiditate quia aspernatur excepturi sit dolorum, fugit harum officia hic quam beatae itaque pariatur atque! Deserunt, provident.</p></div>
<div class="col-lg-3 para3 p-4 shadow mb-4"><p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Facere, rem ratione deserunt necessitatibus ducimus excepturi quisquam hic, eum esse dignissimos laboriosam assumenda sapiente voluptas fugiat nulla inventore repellat consequuntur quasi?
Soluta mollitia voluptatibus molestiae, magnam rerum accusamus veritatis minima totam veniam! Incidunt ratione cupiditate quia aspernatur excepturi sit dolorum, fugit harum officia hic quam beatae itaque pariatur atque! Deserunt, provident.</p></div>
</div>
<div class="row">
<a class="mx-auto mt-4" href="https://www.neramclasses.com"><strong>show some love by adding this link to your website as a credit</strong></a></div></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.6.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
'

Related

On hover first image other 2 image hide and content slide up

<div class="box-2">
<div class="row">
<div class="col-lg-4 col-md-6 col-sm-6 img-height-1" style="">
<div class="img-height-1" style="">
<img src="./assets/images/a.png" width="100%" alt="">
</div>
</div>
<div class="col-lg-4 col-md-6 col-sm-6 img-height-2 mt-sm-0 mt-3" style="">
<div class="img-height-2" style="">
<img src="./assets/images/m.png" width="100%" alt="">
</div>
</div>
<div class="col-lg-4 col-md-6 col-sm-6 img-height-3 mt-lg-0 mt-3" style="">
<div class="img-height-3" style="">
<img src="./assets/images/Rose.png" width="100%" alt="">
</div>
</div>
<div class="col-8 content-1" style="">
<div class="box-3 ">
<h2>Dr.Mahaganapathy Dass</h2>
<h6>Cheif Executive Officer</h6>
<p class="pt-5">
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Iusto, voluptatem! Autem a iste ut id maiores impedit reprehenderit assumenda, quaerat obcaecati perspiciatis blanditiis officia veniam? Corporis a eveniet nulla. Voluptatum fugit recusandae ratione corrupti odio, repudiandae sapiente sed vel inventore earum ad. Totam nihil repellendus, aliquam eum nam distinctio quasi velit quisquam commodi odit culpa voluptate perspiciatis mollitia in porro? Aliquid quas quibusdam laboriosam labore, minima consectetur itaque eveniet amet, nihil at aperiam. Enim magnam eaque rerum soluta repudiandae cupiditate ratione doloribus fugiat, alias pariatur ullam veniam eius autem aspernatur, sed nesciunt voluptatibus quod excepturi sequi perspiciatis deleniti consequuntur! Aliquam!
</p>
<p>
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Mollitia alias veritatis quos maxime sunt soluta accusamus nulla ratione repellat corrupti molestiae, nostrum eligendi, facilis dolorum perferendis ad non unde odio neque. Nihil quia exercitationem animi libero praesentium voluptas placeat suscipit, consequatur molestiae quis minima natus doloribus quidem autem quam veniam?
</p>
<p>
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Esse cupiditate alias cum hic dicta at corrupti? Rerum facilis in aspernatur cupiditate consequatur maiores odit repudiandae, consequuntur sequi eaque minus inventore!
</p>
</div>
</div>
<div class="col-8 content-2" style="">
<div class="box-3 ">
<h2>Dr.Mahaganapathy Dass</h2>
<h6>Cheif Executive Officer</h6>
<p class="pt-5">
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Iusto, voluptatem! Autem a iste ut id maiores impedit reprehenderit assumenda, quaerat obcaecati perspiciatis blanditiis officia veniam? Corporis a eveniet nulla. Voluptatum fugit recusandae ratione corrupti odio, repudiandae sapiente sed vel inventore earum ad. Totam nihil repellendus, aliquam eum nam distinctio quasi velit quisquam commodi odit culpa voluptate perspiciatis mollitia in porro? Aliquid quas quibusdam laboriosam labore, minima consectetur itaque eveniet amet, nihil at aperiam. Enim magnam eaque rerum soluta repudiandae cupiditate ratione doloribus fugiat, alias pariatur ullam veniam eius autem aspernatur, sed nesciunt voluptatibus quod excepturi sequi perspiciatis deleniti consequuntur! Aliquam!
</p>
<p>
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Mollitia alias veritatis quos maxime sunt soluta accusamus nulla ratione repellat corrupti molestiae, nostrum eligendi, facilis dolorum perferendis ad non unde odio neque. Nihil quia exercitationem animi libero praesentium voluptas placeat suscipit, consequatur molestiae quis minima natus doloribus quidem autem quam veniam?
</p>
<p>
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Esse cupiditate alias cum hic dicta at corrupti? Rerum facilis in aspernatur cupiditate consequatur maiores odit repudiandae, consequuntur sequi eaque minus inventore!
</p>
</div>
</div>
<div class="col-8 content-3" style="">
<div class="box-3 ">
<h2>Dr.Mahaganapathy Dass</h2>
<h6>Cheif Executive Officer</h6>
<p class="pt-5">
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Iusto, voluptatem! Autem a iste ut id maiores impedit reprehenderit assumenda, quaerat obcaecati perspiciatis blanditiis officia veniam? Corporis a eveniet nulla. Voluptatum fugit recusandae ratione corrupti odio, repudiandae sapiente sed vel inventore earum ad. Totam nihil repellendus, aliquam eum nam distinctio quasi velit quisquam commodi odit culpa voluptate perspiciatis mollitia in porro? Aliquid quas quibusdam laboriosam labore, minima consectetur itaque eveniet amet, nihil at aperiam. Enim magnam eaque rerum soluta repudiandae cupiditate ratione doloribus fugiat, alias pariatur ullam veniam eius autem aspernatur, sed nesciunt voluptatibus quod excepturi sequi perspiciatis deleniti consequuntur! Aliquam!
</p>
<p>
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Mollitia alias veritatis quos maxime sunt soluta accusamus nulla ratione repellat corrupti molestiae, nostrum eligendi, facilis dolorum perferendis ad non unde odio neque. Nihil quia exercitationem animi libero praesentium voluptas placeat suscipit, consequatur molestiae quis minima natus doloribus quidem autem quam veniam?
</p>
<p>
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Esse cupiditate alias cum hic dicta at corrupti? Rerum facilis in aspernatur cupiditate consequatur maiores odit repudiandae, consequuntur sequi eaque minus inventore!
</p>
</div>
</div>
</div>
</div>
On hover first image other 2 image hide and content slide up, On first hover on image other 2 images hide and content comes up with animation, the process go on for other images also on hover,On hover first image other 2 image hide and content slide up, On first hover on image other 2 images hide and content comes up with animation, the process go on for other images also on hover
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
// Content-1 Img-1
$(document).ready(function(){
// Image show/Hide
$('.img-height-1').hover(function(){
$('.img-height-2, .img-height-3').css('display','none');
// content show
$('.content-1').css('display','block');
},function(){
$('.img-height-2, .img-height-3').css('display', '');
// content show
$('.content-1').css('display', '');
} );
// Image show/Hide
$('.img-height-2').hover(function(){
$('.img-height-1, .img-height-3').css('display','none');
// content show
$('.content-2').css('display','block');
},function(){
$('.img-height-1, .img-height-3').css('display', '');
// content show
$('.content-2').css('display', '');
} );
// Image show/Hide
$('.img-height-3').hover(function(){
$('.img-height-2, .img-height-1').css('display','none');
// content show
$('.content-3').css('display','block');
},function(){
$('.img-height-2, .img-height-1').css('display', '');
// content show
$('.content-3').css('display', '');
} );
})</script>
Please visit this site and make sure that you are looking for same type of css hover effect on image at the middle of the page have.
https://ecommerce-project-eight.vercel.app/
Then I will let you know which code I have used.

Bootstrap 5. how to remove page scrolling

I want to make sure that only the card-body block scrolls. Now the page scrolls a bit when the card-body block overflows (there are 2 scroll bars). The lorem text was inserted for an overflow example.
The result should be as in the picture. The crossed-out scroll bar should be removed, and the ticked one should remain
enter image description here
html, body {
height: 100%;
}
.ts_panel {
height: 100%;
border-right: 2px solid #646464;
background: rgb(44,44,44);
}
.ts_usernameInp {
width: 40%;
margin: 0 auto;
}
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<title></title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.2.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmVor" crossorigin="anonymous">
<link rel="stylesheet" href="index.css">
</head>
<body>
<div class="container-fluid d-flex h-100 flex-column">
<header class="row justify-content-center align-items-center bg-dark text-white text-center py-2">
<span>Ссылка для подключения к чату: 127.0.0.1:8000/chat/?chat_id=tZGuDGqdHa0e3IAfTRY7</span>
</header>
<div class="row h-100">
<div class="col-2 ts_panel">
<h1 class="text-center text-white">Чат</h1>
</div>
<div class="col-10 p-0 h-100">
<div class="card w-100 h-100">
<form class="h-100" action="" method="post">
<div class="d-flex flex-column h-100">
<div class="card-header flex-fill text-center">
<input type="text" class="form-control ts_usernameInp" placeholder="Username" aria-label="Username" aria-describedby="basic-addon1">
</div>
<div class="card-body flex-fill overflow-auto">
Obcaecati dolor quam voluptate praesentium quaerat et maxime provident tempora alias suscipit facere est, laborum ad aperiam quas animi corporis neque delectus nostrum hic nisi! Omnis, ea atque.Lorem ipsum dolor sit amet consectetur adipisicing elit. Nostrum, nam expedita fugiat aperiam, ad corporis voluptatem laudantium assumenda deleniti, cum quasi voluptatibus. Beatae cum ratione debitis expedita ducimus veritatis suscipit, quod aperiam magni nihil ab voluptas dolorum eaque? At necessitatibus tempora enim, quisquam possimus ipsa provident fugiat quaerat nobis. Delectus aliquam porro beatae rerum eligendi distinctio ab voluptatem vero dignissimos neque in itaque maiores nostrum aspernatur excepturi, minima totam magni nesciunt blanditiis, accusamus hic consequatur! Sint eveniet error optio corrupti dicta dolores reprehenderit quas molestiae, saepe exercitationem culpa commodi doloremque cum rem quod sit accusamus enim alias. Quod dolore veritatis a magni, dolor cum quo libero enim reprehenderit, aut ex, nobis et possimus reiciendis dolorem. Quae, fugit quasi! Voluptatum saepe numquam quam, nobis sint ipsam maiores sunt? Eius ab quasi aut ullam aliquam architecto, placeat optio dolorum cumque odio dolorem recusandae explicabo cum. Consequuntur odit a illum tenetur illo exercitationem architecto soluta corrupti, temporibus voluptate consequatur maxime impedit praesentium quisquam eius dolorem. Aspernatur, neque tenetur corporis inventore quisquam aliquid perferendis eaque doloremque. Laborum laboriosam magnam alias nam blanditiis temporibus omnis dolor, quae sint modi officiis earum possimus voluptatibus. Molestiae nihil debitis repellat provident officiis sint quaerat aliquam eos eum accusantium aliquid, quam exercitationem nesciunt dolorum, sunt maxime. Consequatur consectetur sunt explicabo aperiam ipsam eaque labore obcaecati cupiditate. A ut culpa similique ipsam illo ducimus placeat id eligendi officia nulla beatae quasi sunt cum rem, consequatur nisi nam ab? Impedit cum assumenda reprehenderit consectetur?
</div>
<div class="flex-fill card-footer">
<div class="input-group">
<input type="text" class="form-control" placeholder="Введите сообщение" aria-label="Сообщение" aria-describedby="basic-addon2">
<div class="input-group-append">
<button class="btn btn-primary" type="button">Отправить</button>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</body>
</html>
Okay, you must use this for block scrolling bars overflow-y: hidden; overflow-x: hidden; but you must make Mobile optimalization use https://www.w3schools.com/cssref/css3_pr_mediaquery.asp and add the new css and done fixed.
html, body {
height: 100%;
overflow-y: hidden;
overflow-x: hidden;
}
if you need still help, make comment i help you.

Why two elements are not on same line with width 80% and 20% CSS [duplicate]

This question already has answers here:
How to remove the space between inline/inline-block elements?
(41 answers)
Closed 2 years ago.
I've two elements (one p and another one img) in a simple container without styling (except background). I've specifically styled both of the elements to be inline-block and border-box but when the total of their length is less than 100% even, 99% only then they appear on same line.
What would possibly be the reason.
Here is the link to jsfiddle.
https://jsfiddle.net/098jrt7q/
use display:flexto the parent container .content ,I added the snippet below.I'm added the Snippet with 100% width (80+20) .
.content {
background: #eeeeee;
display:flex;
}
p {
display: inline-block;
width: 80%;
box-sizing: border-box;
}
img {
box-sizing: border-box;
width: 20%;
display: inline-block;
}
<div class="content">
<p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Dignissimos sequi fugiat sint nihil quo unde deleniti ratione laudantium dolorum illo odio recusandae est, ab fugit incidunt, molestiae, inventore quam soluta mollitia dolorem! Quaerat
fuga, repellendus quo, at adipisci nihil voluptate molestias asperiores, dolorem maiores amet rerum debitis ullam! Molestias quasi doloribus tempora ratione ipsum similique accusamus debitis voluptatibus deserunt autem consequatur, ut dolor
repellendus at repudiandae? Dolorum modi blanditiis atque consequatur nesciunt repellat doloremque eius quisquam ea dolores, voluptate earum adipisci sit tempora voluptates aspernatur expedita dolorem reiciendis animi nisi, quas mollitia iusto
autem! Quisquam explicabo molestias dignissimos. Similique iste beatae sed? Mollitia commodi aperiam provident cum alias sapiente esse?</p>
<img src="https://source.unsplash.com/random/200x200" alt="">
</div>
They are side by side actually, with respect to the base line. If you open developer window and try to extend it, say to 2000 view port width..You will get to know... But it's the content of the paragraph <p>...</p> which keeps adjusting itself to accommodate its content. Over all w.r.t base line of their parent element they are side by side. Thank You :)
Any whitespace between inline-block elements takes up space.
Either:
remove the whitespace
.content {
background: #eeeeee;
}
p {
display: inline-block;
width: 80%;
}
img {
display: inline-block;
width: 20%;
}
<div class="content">
<p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Dignissimos sequi fugiat sint nihil quo unde deleniti ratione laudantium dolorum illo odio recusandae est, ab fugit incidunt, molestiae, inventore quam soluta mollitia dolorem! Quaerat fuga,
repellendus quo, at adipisci nihil voluptate molestias asperiores, dolorem maiores amet rerum debitis ullam! Molestias quasi doloribus tempora ratione ipsum similique accusamus debitis voluptatibus deserunt autem consequatur, ut dolor repellendus
at repudiandae? Dolorum modi blanditiis atque consequatur nesciunt repellat doloremque eius quisquam ea dolores, voluptate earum adipisci sit tempora voluptates aspernatur expedita dolorem reiciendis animi nisi, quas mollitia iusto autem! Quisquam
explicabo molestias dignissimos. Similique iste beatae sed? Mollitia commodi aperiam provident cum alias sapiente esse?</p><img src="https://source.unsplash.com/random/200x200" alt="">
</div>
Or set font-size:0 on the parent element.
.content {
background: #eeeeee;
font-size: 0;
}
p {
display: inline-block;
width: 80%;
font-size: initial;
}
img {
display: inline-block;
width: 20%;
}
<div class="content">
<p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Dignissimos sequi fugiat sint nihil quo unde deleniti ratione laudantium dolorum illo odio recusandae est, ab fugit incidunt, molestiae, inventore quam soluta mollitia dolorem! Quaerat fuga,
repellendus quo, at adipisci nihil voluptate molestias asperiores, dolorem maiores amet rerum debitis ullam! Molestias quasi doloribus tempora ratione ipsum similique accusamus debitis voluptatibus deserunt autem consequatur, ut dolor repellendus
at repudiandae? Dolorum modi blanditiis atque consequatur nesciunt repellat doloremque eius quisquam ea dolores, voluptate earum adipisci sit tempora voluptates aspernatur expedita dolorem reiciendis animi nisi, quas mollitia iusto autem! Quisquam
explicabo molestias dignissimos. Similique iste beatae sed? Mollitia commodi aperiam provident cum alias sapiente esse?</p>
<img src="https://source.unsplash.com/random/200x200" alt="">
</div>

Bootstrap 4.2.1, text appears outside the div

the text inside div is going outside, I don't know how to fix it. I've tried the way of putting columns in the order like shown in my code from here:
How can I get a Bootstrap column to span multiple rows?
An Image used as a template
How the page looks like
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>About us</title>
<!-- versioning can often help (href="css/style.css?ver=2.0") -->
<!-- BOOTSTRAP 4 -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<style>
body {
background-color: #696969;
margin-top: 100px;
}
.well {
background-color: #deedee;
margin: 3px;
}
</style>
</head>
<body>
<div class="container-fluid text-center">
<div class="row">
<div class="col-md-7">
<div class="row">
<div class="col-md-12">
<div class="well">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptate, molestiae saepe! Facilis quidem dolorem temporibus mollitia doloremque, possimus voluptas error aperiam iusto repellendus numquam, laudantium nemo a, debitis nam eveniet repellat rem voluptates culpa iure nisi quae asperiores nulla molestiae consequatur. Facilis quos soluta necessitatibus, excepturi libero. Veritatis impedit expedita architecto assumenda quo cum earum reprehenderit ad reiciendis, explicabo consequatur, iste facilis vel esse nesciunt nihil animi minima eum accusantium eveniet nam. Dolor quas voluptates, officiis numquam corporis quos. Doloribus nisi maiores placeat quas minima, autem numquam natus totam quidem nostrum, quos vel illo magnam blanditiis quam eligendi sed voluptates.</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="well">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptate, molestiae saepe! Facilis quidem dolorem temporibus mollitia doloremque, possimus voluptas error aperiam iusto repellendus numquam, laudantium nemo a, debitis nam eveniet repellat rem voluptates culpa iure nisi quae asperiores nulla molestiae consequatur. Facilis quos soluta necessitatibus, excepturi libero. Veritatis impedit expedita architecto assumenda quo cum earum reprehenderit ad reiciendis, explicabo consequatur, iste facilis vel esse nesciunt nihil animi minima eum accusantium eveniet nam. Dolor quas voluptates, officiis numquam corporis quos. Doloribus nisi maiores placeat quas minima, autem numquam natus totam quidem nostrum, quos vel illo magnam blanditiis quam eligendi sed voluptates.</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="well">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptate, molestiae saepe! Facilis quidem dolorem temporibus mollitia doloremque, possimus voluptas error aperiam iusto repellendus numquam, laudantium nemo a, debitis nam eveniet repellat rem voluptates culpa iure nisi quae asperiores nulla molestiae consequatur. Facilis quos soluta necessitatibus, excepturi libero. Veritatis impedit expedita architecto assumenda quo cum earum reprehenderit ad reiciendis, explicabo consequatur, iste facilis vel esse nesciunt nihil animi minima eum accusantium eveniet nam. Dolor quas voluptates, officiis numquam corporis quos. Doloribus nisi maiores placeat quas minima, autem numquam natus totam quidem nostrum, quos vel illo magnam blanditiis quam eligendi sed voluptates.</div>
</div>
</div>
</div>
<div class="col-md-5">
<div class="well m-0">
<div class="row">
<div class="col-md-7">
Jan Kustra
<br>
<br>
<br>
<br>
<br>
<br>
</div>
<div class="col-md-5">
<img src="img/300.png" alt="my face" width="50%" class="float-right">
</div>
</div>
<div class="row">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Magni similique, suscipit laudantium, error explicabo repellat aperiam, ullam ab non exercitationem vitae, totam quidem eaque labore. Totam neque eaque architecto facilis, unde laudantium quas. Id vel, unde error, fugiat vero ipsa dicta doloribus mollitia ea et eaque incidunt esse. Aliquid ipsa perspiciatis reiciendis, eligendi dolorum architecto, voluptatum, consectetur similique ex quo ad nam, itaque officiis id porro ducimus doloremque reprehenderit. Inventore vel rem voluptatem ullam ab itaque harum rerum, ut hic modi facilis minus quibusdam, veniam quam ipsum. At maiores tenetur, natus illo repudiandae velit, similique harum accusantium voluptatum, quia quas!</p>
</div>
</div>
</div>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js" integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>
You're missing the column surrounding the text block.
Yours:
<div class="row">
<p>Lorem ipsum...</p>
</div>
Correct:
<div class="row">
<div class="col-md-12">
<p>Lorem ipsum...</p>
</div>
</div>

Avoid whitespaces with float left

I would like to know how I can avoid the big whitespace using float: left, all the block does not have the same height
here's a demo
<div class="container">
<div class="block">
<div class="content">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Laudantium, molestias vel quia ratione a nostrum quae provident facere perspiciatis commodi!</div>
</div>
<div class="block">
<div class="content">Est, eaque, enim? Illo, incidunt, molestias aut expedita aspernatur consectetur quos sit accusantium hic mollitia beatae numquam itaque excepturi eaque.</div>
</div>
<div class="block">
<div class="content">Nihil, quibusdam animi voluptatum modi pariatur aliquam adipisci nostrum placeat eos atque maxime odit optio molestias nisi dignissimos. Cum, vel?</div>
</div>
<div class="block">
<div class="content">Tempore, adipisci voluptatibus iure temporibus aut hic deleniti inventore accusantium excepturi vel et omnis veritatis itaque nesciunt odit ut nemo?</div>
</div>
<div class="block">
<div class="content">Voluptas, dignissimos, reiciendis, rem quasi neque quia molestiae in consequatur animi at et qui sint nihil ipsum corrupti totam repudiandae?</div>
</div>
<div class="block">
<div class="content">Tempora, velit, incidunt a est sed nostrum optio suscipit in sint eveniet architecto pariatur culpa asperiores minus praesentium perspiciatis dignissimos.</div>
</div>
<div class="block" style="height:200px"><!-- this height is for example, the height can be higher or lower -->
<div class="content">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aperiam, enim, quidem laudantium quo iusto deleniti sed assumenda placeat dolorem est?</div>
</div>
<div class="block">
<div class="content">Earum, ut, laudantium, eaque, quaerat architecto officiis magni iusto eum nesciunt asperiores illum sit. Et officiis modi tempore mollitia sunt.</div>
</div>
<div class="block">
<div class="content">Nobis, placeat, tenetur tempore facere reiciendis illo reprehenderit sunt a ratione hic deleniti quaerat fuga ex minus eum culpa laborum.</div>
</div>
<div class="block">
<div class="content">Qui, nostrum, ab, totam, molestias quaerat expedita saepe odit accusamus reiciendis rerum officia provident iusto voluptate quis quos sit nisi.</div>
</div>
<div class="block">
<div class="content">Eum, dolorem, qui, autem dolorum et molestiae asperiores rerum eius minus iste quaerat labore distinctio vel cum quis atque consequatur.</div>
</div>
<div class="block">
<div class="content">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iure est magni necessitatibus consequatur deleniti aut veniam repellat quis similique ab.</div>
</div>
<div class="clear"></div>
</div>
Style.css
body {color:white;}
.clear{clear: both;}
.block {float:left;width: 50%;height:100px;}
.content {margin: 10px; padding: 10px; background-color: #000;}
Using regular css you can't really avoid the whitespace underneath each of your elements.
The only way to do it with css would be to have all of your content arranged in columns, not all actually floated left.
Most people get around this problem by using a plugin such as http://masonry.desandro.com/ which uses jQuery/JavaScript to make it work.
Hope that helps.