I could put one photo over another photo by below code but it is not exactly on center of another photo. if foreground photo is bigger than background photo. it should automatically resize to fit center as well. how could i achieve this effect? any hints will be more than welcome!
<!Doctype>
<html>
<head>
<style>
.background
{
position:relative;
top: 10px;
left: 10px;
z-index: 1;
margin: 0 auto;
}
.foreground
{
position:absolute;
top: 25px;
left: 25px;
z-index: 2;
margin: 0 auto;
}
</style>
</head>
<body>
<img src="frame.png" class="background" >
<img src="foreground.png" class="foreground">
</body>
</html>