I'm running into an issue with absolute positioning on my website:
I'm trying to place a button relative to its parent element, and here is what I've attempted:
.parent {
position: relative;
}
.child {
position: absolute;
top: 0px;
left: 0px;
}
.button {
height: 55px;
width: 180px;
background-color: transparent;
border-color: transparent;
background: url(Button.png);
background-size: 100% auto;
background-repeat: no-repeat;
}
<div class="parent" align="middle">
<img src="http://via.placeholder.com/1900" width="1900px" />
<div class="child">
<button class="button">Button</button>
</div>
</div>
This code is causing the button to be positioned relative to the window instead of the image it should be aligning with. Therefore, when zooming in or out, the button moves within the image rather than maintaining the same relative position.