javascript - Why does Image change position on browser size change -
i have image in html , when change size of browser image , text boxes change size , position. can explain why so??
#economy123{ position:absolute; top:67%; left:53%; } <div class="result-temp" > <img id="economy123" src="{{ asset('assets/images/economy123.png') }}" > </div>
if want image stay on same spot after resize browser need use pixels instead of percentages.
for example:
.result-temp{ width: 400px; height: 400px; } #economy123{ position:relative; top: 100px; left: 100px; width: 200px; height: 200px; } <div class="result-temp"> <img id="economy123" src="{{ asset('assets/images/economy123.png') }}" > </div>
this keep image centered after browser resized.
Comments
Post a Comment