if you apply position: relativeto divwhich you want to pay back, then position: absolutethe image will be calculated relative to the closed div, and not the whole page, if it is a child. i.e.
<div id="tobecoverd">
<p>your content...</p>
<img src="./img/transparent.png" class="cover" />
</div>
div#tobecovered{
position: relative;
}
div#tobecovered img.cover{
position: absolute;
top: 0;
left: 0;
}
source
share