I'm having an issue with arranging a series of images within a div where they stack on top of each other. The div has a CSS width of 450px
, and the top image always matches this width. Subsequent images vary in size and need to be aligned flush right with 36px
of padding on the right side.
This is what my current code looks like:
<div id="photos">
<img style="position:relative; top:0px; width:450px" src="images/picture1.jpg" />
<img style="position:relative; top:0px; float:left; left:100px" src="images/picture2.jpg" />
<img style="position:relative; top:0px; float:right; right:36px" src="images/picture3.jpg" />
</div>
However, the second and third images are not stacking properly and appear next to each other instead. Even after inserting a break tag following the second picture, I still encounter the same issue.
I attempted changing the div's display property to block
, but it did not resolve the problem.