I am unable to understand why the child image which is absolute positioned is getting its offset with respect to its parent which is also absolute. but, by definition it should position with respect to relative closest ancestor
.supparent {
width:100%;
height:300px;
position:relative;
}
.parent {
position:absolute;
top : 10%;
left:10%;
}
.im {
position:absolute;
top:0%;
left:0%;
}
<div class="supparent">
<div class="parent">
<img src="https://tpc.googlesyndication.com/simgad/2621399702091823008" class="im">
</div>
</div>
And what is the hack to make it position with respect to supparent