Darkness Posted December 28, 2007 Share Posted December 28, 2007 Hello.How do you display an image ON an image using certain co-ordinates? That is probably much too difficult to understand, therefore I will explain better.If I have an image with the dimensions of... let's say, 500x500, and it was named "example1.png", and I had another image with the dimensions of 50x50, and it was named "example2.png", how would I display example2.png on example1.png and choose the co-ordinates for example2.png to be placed?Thanks. Link to comment Share on other sites More sharing options...
Ingolme Posted December 28, 2007 Share Posted December 28, 2007 You don't even need javascript for this, with HTML and CSS you can do it. This code should do what you want. <div style="position: relative"><img src="example1.png" style="position: absolute; left: 0px; top: 0px;"><img src="example2.png" style="position: absolute; left: 80px; top: 90px;"></div> Change "left" and "top" from the second image as you like. These images are inside a <div>, if you move the first image you'll have to add the left and top of that one to the distance you want in the second image. Link to comment Share on other sites More sharing options...
Darkness Posted December 28, 2007 Author Share Posted December 28, 2007 I see. Thanks a lot. =) Link to comment Share on other sites More sharing options...
Coolguy Posted January 15, 2008 Share Posted January 15, 2008 z-index can also be used to set the stacking order of elements Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.