Well, you can adjust the CSS for the overlay class and instead of positioning it absolutely at the bottom, you can use flexbox to vertically align the text to the bottom. Here's how you can modify the CSS:
.overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5); /* Black see-through */
color: #f1f1f1;
display: flex;
flex-direction: column;
justify-content: flex-end;
align-items: center;
padding: 20px;
}
With these adjustments, the text in the overlay will stay at the bottom of the image while covering the entire image with the black background.