|
i have a container div which has a table inside it. in one of the table data i have image1 width=197 height=123, i want to position a small image image2 on top of image1 which has a width = 107 and height = 47 using positioning.
i want the small image image2 to be positioned at the top left corner of image1 so that it appears that image2 is on top of image1. i have tried using relative position for image1 and absolute position for image2 however i am getting different results in different browsers.
following is my code
<div class="divname">
<table width="199" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<img src="images/image1.jpg" class="image1" /> <img src="images/image2.jpg" class="image2" />
</td>
</tr>
</table>
</div>
.divname{
float: left;
width: 199px;
height: auto;
padding: 0 10px 5px 10px;
}
.divname table td img.image1 {
position: absolute;
top: 0px;
left: 0px;
}
.divname table td img.image2 {
position: relative;
top: 0px;
left: 0px;
}
can someone tell me how to fix this.
thanks
|