title: Responsive CSS - how to 'dynamically' align div to parent width with padding/margin?
body: <p>I can't make it any clearer than this, sorry. I want to properly align 4 divs (on a width of 1150px as that is max-width of the content div) and upon resizing when it can't do 4, 3 in the center etc etc)</p>
  
  <p>On >1150px screens it would/should like this: <a href="http://i.imgur.com/KaOPqZK.png" rel="nofollow">http://i.imgur.com/KaOPqZK.png</a>. Now, the closest I can come is this: <a href="http://i.imgur.com/6khwQkR.png" rel="nofollow">http://i.imgur.com/6khwQkR.png</a>. I can set the first-child margin to 0 on the left one, but as there are multiple rows, those would still have the padding. Creating new rows as divs isn't possible either, because that would ruin everything when it's resized and only shows 3/1 on both rows.</p>
  
  <p>When resizing it should center, with even margins on all sides, and not like this as it is right now: <a href="http://i.imgur.com/GiR1nZ2.png" rel="nofollow">http://i.imgur.com/GiR1nZ2.png</a>.</p>
  
  <p>Basically all the code I have right now is this, simply because I know of no other way.</p>
  
  <pre><code>div.project-container {
      float: left;
      margin: 0 8px 30px 8px;
      position: relative;
      width: 270px;
  }
  </code></pre>
  
  <p>I'm guessing it has to be Javascript who rescues the day, and I'm fine with that. Pointers in the right direction, examples on the internets, all is welcome. Thank you.</p>