title: How to put an image inside of a smaller div in the middle?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/8149747/aligning-image-to-center-inside-a-smaller-div">Aligning image to center inside a smaller div</a>  </p>
  </blockquote>
  
  
  
  <p>I have a problem which points to CSS 3. Please see the part of my HTML code:</p>
  
  <pre><code>&lt;div id="main" style="width: 320px; height: 400px;"&gt;
     &lt;img src="test.jpg" height="400" /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I don't know the real sizes of the test.jpg file (width can be different - the file is dynamic). I want to have the image in the middle of id="main" (I don't care, that the left &amp; right part of the image will be out of range - it's even better). How can I do that ?</p>