CSS: Making two transparent images overlapping

Posted by Pierre on Stack Overflow See other posts from Stack Overflow or by Pierre
Published on 2010-04-04T16:12:26Z Indexed on 2010/04/04 16:13 UTC
Read the original article Hit count: 318

Filed under:
|
|
|

Hi all, I'm trying to make two transparent images (having the same size/dimension ) overlapping into a div at their top left corner. I tried:

<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<div style="margin:20px;">
<div id="main" style="overflow:hidden;background-color:red;width:400px;height:400px;border:3px solid blue;">
<img src="myimage1.png" style="position:relative;top:0px;left:0px;z-index:0;"/>
<img src="myimage2.png" style="position:relative;top:0px;left:0px;z-index:10;"/>
</div>
</div>
</body>
</html>

but it doesn't work, the two pictures are concatenated into the parent div.

Thanks for your help !

© Stack Overflow or respective owner

Related posts about css

Related posts about image