I'm brainstorming creative ways to handle a webpage section where the image will be swapped out with various images (with widths up to 620px) and a text caption is positioned over it. I aim for the text to adjust its absolute position based on the width of the image, not the width of the relatively positioned container.
One idea that crossed my mind is using background-image instead of an actual image, but then I'd have to address the issue of having an empty div with a background image, requiring a hardcoded height - which won't accommodate varying image heights.
If anyone has any solutions or suggestions, I'd appreciate hearing them. Thank you!