title: Better way to auto resize images mantaning aspect ratio?
body: <p>I am using this code to auto resize images to the window size on a mobile page:</p>
  
  <pre><code>img {
    width:100%;
    max-height : auto;
    max-width : 480px;
  }
  </code></pre>
  
  <p>My intention is to show the image in the right size of the window on small screens and max 480px on bigger screens maintaining the ratio.</p>
  
  <p>But for some reason i dont know when i use that code the text around the image goes behind it.</p>
  
  <p>Theres a way to achieve this result using another method like Java or Jquery and avoid this problem?</p>