title: Center a block of images with CSS
body: <p>Using the box model I’ve created a 3 by 3 grid of images. I wanted all the images centered so I wrapped all the images in a div and set the padding-left to 10%.
  This worked but I’m assuming it wasn’t the correct way of doing this, so I’m asking for someone to tell me what I should’ve done instead.
  HTML and CSS below… </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>img {
    width: 30%;
    float: left;
    margin: 0.1%;
    max-width: 700px;
  }
  
  .block {
    padding-left:10%;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="block"&gt;
    &lt;img src="placeholder.png"&gt;
    &lt;img src="placeholder.png"&gt;
    &lt;img src="placeholder.png"&gt;
    &lt;img src="placeholder.png"&gt;
    &lt;img src="placeholder.png"&gt;
    &lt;img src="placeholder.png"&gt;
    &lt;img src="placeholder.png"&gt;
    &lt;img src="placeholder.png"&gt;
    &lt;img src="placeholder.png"&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>