title: Centering a <div> with a max-width, using Javascript/JQuery
body: <p>I've been looking for a way to center a div with a set max-width. I assumed I could do so by giving the div a max-width of 90% and an auto margin, then use jQuery to find and set a fixed width, which I hoped, the auto margin would then center for me.</p>
  
  <p>Something like the following.</p>
  
  <p><strong>JQuery:</strong></p>
  
  <pre><code>$(function(){
      $wrap = $('#wrap');
  
      $wrap.width($wrap.width());
  });
  </code></pre>
  
  <p><strong>CSS:</strong></p>
  
  <pre><code>#wrap {
      max-width:90%;
      margin:auto;
  }
  </code></pre>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;div id="wrap"&gt;
       &lt;img src="http://icdn.pro/images/en/h/a/happy-smiley-face-icone-6672-96.png" /&gt;
       &lt;img src="http://icdn.pro/images/en/h/a/happy-smiley-face-icone-6672-96.png" /&gt;
       &lt;img src="http://icdn.pro/images/en/h/a/happy-smiley-face-icone-6672-96.png" /&gt;
       &lt;img src="http://icdn.pro/images/en/h/a/happy-smiley-face-icone-6672-96.png" /&gt;
       &lt;img src="http://icdn.pro/images/en/h/a/happy-smiley-face-icone-6672-96.png" /&gt;
  &lt;/div&gt;&lt;!-- end div id="wrap" --&gt;
  </code></pre>
  
  <p>So basically, I wanna make a wrapper div that I can jam full of images, but will not exceed 90% screen width; take wrapper and center it. Is this possible? I understand my JQuery thinking is almost certainly wrong. I'm very new to it, but I assumed that Javascript is the way to go about this.</p>