I am assuming this question has been answered many times over, but unfortunately after couple hours of searching I am still not able to solve it.
Can someone tell the best way to keep text position in relation to a sibling div/image on window resize?
Please find fiddle attached:
.wrapper img {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
z-index: 0;
}
.text-box {
z-index: 1;
position: relative;
top: 20px;
left: 20px;
}
<div class="wrapper">
<div class="text-box">
<p>lorem ipsum</p>
<p>lorem ipsum</p>
</div>
<a href="https://placeholder.com"><img src="http://via.placeholder.com/770x690"></a>
</div>