I am facing a challenge where I want to place two input elements inside an image element. However, after setting the position of the input elements to absolute, only the left input successfully entered inside the image element while the right one remained outside.
I am curious as to why this is happening and I am in need of a solution to ensure that both inputs are placed correctly inside the image.
.container-fluid {
text-align: center;
position: relative;
}
img {
display: inline;
max-height: 100%;
}
.myB {
position: absolute;
top: 50%;
}
<div class='container-fluid'>
<input class='myB' type='button' value='<'>
<img src="https://www.w3schools.com/w3css/img_mountains.jpg" class="img-fluid" alt="Responsive image">
<input class='myB' type='button' value='>'>
</div>