I'm attempting to overlay text on two images placed side by side to fill the entire page. Here is the code:
HTML:
<div class="main">
<img src="city.jpg" class="city" alt="city">
<img src="couple.jpg" class="couple" alt="couple">
</div>
CSS:
.main {
display: flex;
justify-content: space-between;
width: 100%;
height: 152.5vh;
}
.city {
flex-basis: 50%;
height: 100%;
object-fit: cover;
display: block;
}
.couple {
flex-basis: 50%;
height: 100%;
object-fit: cover;
display: block;
}
Both images are aligned without gaps in between. I want to insert text in the center on top of both images. What can I attempt to achieve this?
I have searched online for a solution, but nothing has worked or was too complex to understand and implement. Thank you in advance!