    .image-container { position: relative; display: inline-block; } 
.image-container img { width: 100%; display: block;} .caption { position: absolute; bottom: 0; left: 0; width: 100%; background: rgba(0, 0, 0, 0.6); /* Semi-transparent background */ color: white; padding: 10px; font-size: 18px; text-align: center; }