Friday, August 16, 2013

CSS One Image on Top of Another

This is some simple CSS to overlay one image on top of another.
<div style="position: relative; left: 0; top: 0;">
  <img src="a.jpg" style="position: relative; top: 0; left: 0;"/>
  <img src="b.jpg" style="position: absolute; top: XXX; left: XXX;"/>
</div>
a.jpg will be the main image and b.jpg would be the image you want over top.  You can position the overlay image using the top and left attributes.

No comments:

Post a Comment