I'm looking to achieve a similar effect with overlapping elements as shown in the attached file. What would be the best code approach to achieve this? I am currently using bootstrap 4.6.2, can it be of assistance?
Thank you for your guidance.
Although I have managed to make it work with the following code, I am not certain if it is the optimal solution as I have to adjust the 'top' position when the text and div height change.
.text-container {
top: 44%;
left: 0;
transform: translateY(-50%);
width: 75%;
z-index: 2;
position: absolute;
padding: 10% 4% 14% 2% !important;
}
.border-danger {
border-color: #FF6F61 !important;
border: solid 1px;
}
.text-danger {
color: #FF6F61 !important;
}
.list-group-item {
border-bottom: 1px solid black;
}
.list-group-item:last-child {
border-bottom: none;
}
a.list-group-item:hover {
color: #000;
}
.img-fluid {
z-index: 1;
position: relative;
}
.image-right {
z-index: 1;
position: relative;
margin-left: auto;
}
#coaching-img {
width: 50%;
margin-top: 6%;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/4.6.2/css/bootstrap.min.css" integrity="sha512-rt/SrQ4UNIaGfDyEXZtNcyWvQeOq0QLygHluFQcSjaGB04IxWhal71tKuzP6K8eYXYB6vJV4pHkXcmFGGQ1/0w==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<section id="main_content" class="">
<div class="container mt-5">
<div class="row justify-content-end">
<div class="col-md-12 position-relative d-flex justify-content-end">
<div class="text-container border border-danger rounded p-4">
<div class="col-md-8">
<h2 class="text-danger">Profitez d'un accompagnement et de coaching personnalisé</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla non est vitae nulla porttitor fringilla id eu dui. Donec eget cursus ex. Maecenas bibendum sodales augue.</p>
<div class="list-group">
<a href="#" class="list-group-item list-group-item-action d-flex justify-content-between align-items-center">
Bloc de 1 heure <span>→</span>
</a>
<a href="#" class="list-group-item list-group-item-action d-flex justify-content-between align-items-center">
Bloc de 3 heures <span>→</span>
</a>
<a href="#" class="list-group-item list-group-item-action d-flex justify-content-between align-items-center">
Bloc de 5 heures <span>→</span>
</a>
</div>
</div>
</div>
<img id="coaching-img" src="https://via.placeholder.com/600x400" alt="Coaching Image" class="img-fluid rounded image-right">
</div>
</div>
</div>
</section>