I tried to center a div with 2 photos exactly in the center. However it didn't go well. Tried different types of positioning, display flex, align items justify content, etc, nothing allows me to move image container to the center.
Here is my code:
.grid {
display: grid;
gap: 1.5rem;
}
.section {
padding: 4.5rem 0 2rem;
}
.home_container {
position: relative;
align-items: center;
justify-content: center;
}
.home_images {
position: absolute;
display: flex;
left: 50%;
top: 50%;
}
.home_big-img {
z-index: 12;
}
.home_small-img {
transform: translateX(-9rem);
}
<section class="section home grid">
<div class="home_container container">
<div class="home_images">
<img src="./img/man.png" alt="" class="home_big-img">
<img src="./img/plane.png" alt="" class="home_small-img">
</div>
</div>
</section>
Here is first image:
And here is second one: