title: Why put an <img> inside a container (like a <div>, for instance)?
body: <p>I am just learning to code and have been looking everywhere for an answer on this one and for some reason cannot find anything.</p>
  
  <p>I noticed that it seems to be common practice to put an image inside of a container or wrapper.  For instance, rather just having:</p>
  
  <pre><code>&lt;img src="url"/&gt;
  </code></pre>
  
  <p>Everyone seems to be in agreement that it needs to be this way:</p>
  
  <pre><code>&lt;div class="container"&gt;
  &lt;img=src"url"/&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>What is the purpose of wrapping the img inside of a div in this way?  It seems to have something to do with "responsive design", but I'm not 100% sure.  Is it just so that we have something to size the image relative to, rather than using definite sizing like pixels on the image selector in css?  The more I think about it as I write this, the more it seems to be the right answer, but I'm not sure if there's something else I'm missing on this one.</p>
  
  <p>Any insight would be very much appreciated.  Thank you.</p>