I am facing an issue with multiple images overlaid on top of a background in my web design. Here's a sample code snippet that showcases the problem:
<div style="position: relative; left: 0; top: 0;">
<img src="images/background.png" style="position: relative; top: 0px; left: 0px;"/>
<img src="images/overlay1.png" style="position: absolute; top: 20px; left: 20px; "/>
<img src="images/overlay2.png" style="position: absolute; top: 40px; left: 40px; "/>
</div>
When the browser is in full screen mode, everything appears as intended. However, upon resizing the browser window, only the background image scales proportionally while the overlay images remain static at their original positions. Attempting to change all position attributes to relative
messes up the positioning of the overlay images.
I'm seeking advice on how to modify this setup so that all images within the div tag scale correctly relative to each other. Just to provide more context, I am utilizing Twitter Bootstrap 2.3.2 as the default CSS theme.
For additional information, all images have fixed dimensions - for instance, the background is 640x480 positioned at 0, 0. The overlays also have set sizes and are meant to align precisely with the background image. One overlay might be 64x64 positioned at 15, 24 (top, left), while another could be 128x128 placed at 200, 231, and so forth. It's crucial to maintain these specific overlay positions for the overall composition to appear complete.