title: How to horizontally images resized (via CSS) to fit a box?
body: <p>I'm currently stuck with this problem. I'm resizing a picture via CSS in a box with its height forced. </p>
  
  <pre><code>.img_contener {
  width: 100%;
  height: 400px;
  }
  </code></pre>
  
  <p>There is the CSS for the image resizing :</p>
  
  <pre><code>img {  
  max-width: 100%;
  max-height : auto;
  height: auto;
  width: auto;
  box-sizing: border-box;
  }
  </code></pre>
  
  <p>Now I want to center the resultant picture, which, depending on its height, doesn't fit to the containing box, and which is staying by default on the left.</p>
  
  <p>Both the margin:auto and the text-align:center don't work.</p>
  
  <p>I didn't try out jquery solutions so far... I would rather like a CSS-based solution. My alternative is to force-resize the picture using php.</p>