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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -