title: How to do CSS for a grid of images
body: <p>I would like to create a grid of images, and I've met with what I think must be the most common problem for a grid: namely that <strong>how to remove the margin/padding on the last elements?</strong> I was trying (without success):</p>
  
  <pre><code>#page {
  margin: 0 -8px -8px 0;
  }
  
  #page a {
  float: left;
  margin: 0 8px 8px 0;
  }
  </code></pre>
  
  <p>Why does this code not work? Whats the best way to solve it? </p>
  
  <p>The CSS frameworks forces us to specify the last elements:</p>
  
  <p>960.gs uses:</p>
  
  <pre><code>.alpha {
    margin-left: 0;
  }
  
  .omega {
    margin-right: 0;
  }
  </code></pre>
  
  <p>BluePrint CSS uses:</p>
  
  <pre><code>.last {margin-right: 0;}
  </code></pre>
  
  <p>Golden Grid uses:</p>
  
  <pre><code>.inside {margin-left: 0;}
  </code></pre>
  
  <p>But how can I do it when all I have is a unknown list of images which I would like to put in n-columns? Before, I have written PHP code for this, and I called it with an argument for the number of columns, but there must be some very easy CSS trick for this problem!</p>
  
  <p>(live page link removed, as jsfiddle examples below are much better)</p>