title: How to space flex items within a flex container?
body: <p>I have a flex container that's aligning the child elements along a row in the main-axis. I gave it a space-between for its justify-content in order to maintain some space between both divs.  </p>
  
  <p>I also gave the left div a flex-grow by 3, and the right div stayed constant at 1.</p>
  
  <p>My goal is to show a featured-blog post on the left (hence the flex-grow by 3) and the sidebar on the right (hence the flex-grow by 1). I also want there to be space between both divs. </p>
  
  <p>My code doesn't enable for both divs to share space between them as they are touching next to each other. </p>
  
  <p>here is my code:</p>
  
  <pre><code>&lt;body&gt;
    &lt;nav role="navigation"&gt;
      &lt;ul&gt;
        &lt;li&gt;&lt;a href="articles.htm" title="Articles"&gt;Articles&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="newsletter.htm" title="Newsletter"&gt;Newsletter&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="interest.htm" title="generic interest"&gt;Generic Interest&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="resources.htm" title="resources"&gt;Resources&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="about.htm" title="learn more about me"&gt;About&lt;/a&gt;&lt;/li&gt;
        &lt;li class="search-form"&gt;
          &lt;form action="http://simplerpimate.com" method="post"&gt;
            &lt;label for="search"&gt;Search Generic Blog&lt;/label&gt;
            &lt;input type="search" placeholder="search" title="Search" class="q" name="search" id="search"&gt;
            &lt;input type="submit" class="button" value="Go" name="submit"&gt;
          &lt;/form&gt;
        &lt;/li&gt;
      &lt;/ul&gt;
    &lt;/nav&gt;
    &lt;header role="banner"&gt;
      &lt;hgroup&gt;
        &lt;h1&gt;Generic&lt;span class="generic"&gt;Blog&lt;/span&gt;&lt;/h1&gt;
        &lt;h2&gt;every post a champion&lt;/h2&gt;
      &lt;/hgroup&gt;
    &lt;/header&gt;
    &lt;section role="main" class="main"&gt;
      &lt;article class="featured"&gt;
        &lt;h2&gt;Featured Article&lt;/h2&gt;
        &lt;h3 class="articleHeader teaser"&gt;Lorem Ipsum turns 520&lt;/h3&gt;
        &lt;img src="_images/lorem_title.jpg" alt="moving from print to the web" class="teaser"&gt;
        &lt;p&gt;This year marks the 520th year of Lorem Ipsum text. In that sense, Lorem Ipsum may be the most successfull generic content ever. While we may never know the name of the anonomous typesetter that scrambled the galley of type that created Lorem Ipsum,
          we are all in debt to his visionary use of generic type. Without Lorem Ipsum, countless wireframes, mockups, and prototypes would lack the generic look and feel that make them so compelling to consumers world-wide.&lt;span class="action"&gt;&lt;a href="featured.htm" title="featured article"&gt;continue reading&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
      &lt;/article&gt;
      &lt;aside role="complementary" class="sidebar"&gt;
        &lt;section class="intro"&gt;
          &lt;p&gt;Generic Blog seeks to keep you up to date on the most generic items out there. We want to be your main source for all generic interests and actvities.
            &lt;span class="call"&gt;Welcome&lt;/span&gt;&lt;/p&gt;
        &lt;/section&gt;
        &lt;ul class="social"&gt;
          &lt;li&gt;&lt;a href="https://twitter.com/jameswillweb" title="Follow me on Twitter" class="twitter"&gt;Follow me on Twitter&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="http://www.simpleprimate.com/feed/ " title="RSS Feed" class="rss"&gt;Subscribe to my RSS Feed&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
        &lt;section class="newsletter cf"&gt;
          &lt;h3&gt;Our Newsletter&lt;/h3&gt;
          &lt;p&gt;Interested in keeping up to date with what’s going on in the world of generic content? Sign up for our monthly newsletter and never miss out on your favorite generic news.&lt;/p&gt;
          &lt;p&gt; &lt;a href="#newsletter" class="button right cf"&gt;Sign up!&lt;/a&gt;
          &lt;/p&gt;
        &lt;/section&gt;
        &lt;section class="events"&gt;
          &lt;h3&gt;Upcoming Events&lt;/h3&gt;
          &lt;p&gt;GeneriCon will be held June 20th of this year. They’ll have an amazing line up of generic speakers and topics, so be sure not to miss out!&lt;/p&gt;
        &lt;/section&gt;
      &lt;/aside&gt;
    &lt;/section&gt;
    &lt;section class="spotlight"&gt;
      &lt;article class="latest news"&gt;
        &lt;h2&gt;Featured News&lt;/h2&gt;
        &lt;div class="img-wrap"&gt;&lt;img src="_images/flower.jpg" alt="responsive images community group"&gt;&lt;/div&gt;
        &lt;h3&gt;Generic drugs keep gaining market share&lt;/h3&gt;
        &lt;p&gt;Generic drugs, such as Marzipan Imoximile made from the Harvey Cactus flower (shown above) continue to gain in market share.&lt;/p&gt;
        &lt;p class="call"&gt;&lt;a href="http://responsiveimages.org/" title="Responsive images community group" class="button"&gt;Find out why!&lt;/a&gt;&lt;/p&gt;
      &lt;/article&gt;
      &lt;article class="latest course"&gt;
        &lt;h2&gt;Generic item of the week&lt;/h2&gt;
        &lt;div class="img-wrap"&gt;&lt;img src="_images/city_night.jpg" alt="responsive design fundamentals"&gt;&lt;/div&gt;
        &lt;h3&gt;Generic “city at night” shots remain popular&lt;/h3&gt;
        &lt;p&gt;For many ads and commercials, generic “city at night shots” remain amazingly effective. Come find out which cities offer the most generic shots.&lt;/p&gt;
        &lt;p class="call"&gt;&lt;a href="http://www.lynda.com/Web-Responsive-Design-tutorials/Responsive-Design-Fundamentals/104969-2.html" title="Responsive Design Fundamentals" class="button"&gt;Mash!&lt;/a&gt;&lt;/p&gt;
      &lt;/article&gt;
      &lt;article class="latest review"&gt;
        &lt;h2&gt;Generic facts&lt;/h2&gt;
        &lt;div class="img-wrap"&gt;&lt;img src="_images/beach_yoga.jpg" alt="the truth about HTML5"&gt;&lt;/div&gt;
        &lt;h3&gt;Beach yoga no more effective than generic yoga&lt;/h3&gt;
        &lt;p&gt;Despite the claims of many self-help gurus, beach yoga is no more effective at finding inner peace than generic yoga. An online study shows more.&lt;/p&gt;
        &lt;p class="call"&gt;&lt;a href="http://www.truthabouthtml5.com/" title="The truth about HTML5" class="button"&gt;Mash!&lt;/a&gt;&lt;/p&gt;
      &lt;/article&gt;
    &lt;/section&gt;
    &lt;footer role="contentinfo"&gt;
      &lt;p&gt;&amp;copy; 2012 James Williamson | but honestly just use any of the code as you see fit. I'm really putting this here just so I have a footer.&lt;/p&gt;
    &lt;/footer&gt;
  &lt;/body&gt;
  
  
  
  /* -------------------------------------------------- 
     flexbox layout styles
  -----------------------------------------------------*/
  body {
      width: 90%;
      margin: 0 auto;
  }
  /* -------------------------------------------------- 
     top navigation styles
  -----------------------------------------------------*/
  nav ul {
      display: -webkit-flex;
      display: -ms-flexbox;
      display: flex;
  }
  nav li {
      display: -webkit-flex;
      display: -ms-flexbox;
      display: flex;
      -webkit-align-items: center;
      -ms-flex-pack: center;
      align-items: center;
  }
  nav li.search-form {
      margin-left: auto;
      margin-right: 1em;
  }
  /* -------------------------------------------------- 
     header styles
  -----------------------------------------------------*/
  header hgroup {
      display: -webkit-flex;
      display: -ms-flexbox;
      display: flex;
      -webkit-align-items: baseline;
      -ms-flex-pack: baseline;
      align-items: baseline;
  }
  /* -------------------------------------------------- 
     main content styles
  -----------------------------------------------------*/
  section.main {
      margin-bottom: 2em;
      display: -webkit-flex;
      display: -ms-flexbox;
      display: flex;
      flex-flow: row wrap;
      justify-content: space-between;
  
  }
  /*.featured, .sidebar{
      margin: 4%;
  }*/
  .featured {
      flex: 3;
      background: green;
  }
  .sidebar {
      background: red;
      margin-left: auto;
      flex: 1;
      /*margin-right: 2em;*/
  } 
  ul.social {
      display: -webkit-flex;
      display: -ms-flexbox;
      display: flex;
      -webkit-justify-content: space-around;
      -ms-flex-pack: justify;
      justify-content: space-around;
  }
  /* -------------------------------------------------- 
     spotlight content styles
  -----------------------------------------------------*/
  .spotlight {
      display: -webkit-flex;
      display: -ms-flexbox;
      display: flex;
  }
  .latest{
      flex: 1;
  }
  /*.latest {
      display: -webkit-flex;
      display: -ms-flexbox;
      display: flex;
      -webkit-flex-flow: column;
      -ms-flex-flow: column;
      flex-flow: column;
      flex-direction: column;
  }*/
  /* -------------------------------------------------- 
     footer  styles
  -----------------------------------------------------*/
  footer {
      display: -webkit-flex;
      display: -ms-flexbox;
      display: flex;
      min-height: 4em;
      -webkit-justify-content: center;
      -ms-flex-pack: center;
      justify-content: center;
      -webkit-align-items: center;
      -ms-flex-align: center;
      align-items: center;
  }
  
  /* -------------------------------------------------- 
     Smaller screen styles
  -----------------------------------------------------*/
  @media only screen and (max-width: 720px) {
  
  /*set direction to single column, set ordinal values*/
  body {
      display: -webkit-flex;
      display: -ms-flexbox;
      display: flex;
      -webkit-flex-direction: column;
      -ms-flex-direction: column;
      flex-direction: column;
  }
  nav {
      -webkit-order: 3;
      -ms-flex-order: 3;
      order: 3;
  }
  header {
      -webkit-order: 0;
      -ms-flex-order: 0;
      order:0;
  }
  .main {
      -webkit-order: 2;
      -ms-flex-order: 2;
      order:2;
  }
  .spotlight {
      -webkit-order: 1;
      -ms-flex-order: 1;
      order: 1;
  }
  footer {
      -webkit-order: 4;
      -ms-flex-order: 4;
      order: 4;
  }
  
  /* -------------------------------------------------- 
     top navigation styles
  -----------------------------------------------------*/
  nav ul {
      -webkit-flex-direction: column;
      -ms-flex-direction: column;
      flex-direction: column;
  }
  nav li.search-form {
      -webkit-order: -1;
      -ms-flex-order: -1;
      order: -1;
      margin: 0 0 2em;
      -webkit-align-self: center;
      -ms-flex-item-align: center;
      align-self: center;
  }
  /* -------------------------------------------------- 
    header styles
  -----------------------------------------------------*/
  header hgroup {
      -webkit-align-items: center;
      -ms-flex-pack: center;
      align-items: center;
      -webkit-justify-content: center;
      -ms-flex-pack: center;
      justify-content: center;
  }
  /* -------------------------------------------------- 
     main content styles
  -----------------------------------------------------*/
  section.main {
      display: block;
      margin-bottom: 2em;
  }
  .sidebar {
      display: -webkit-flex;
      display: -ms-flexbox;
      display: flex;
      -webkit-flex-direction: column;
      -ms-flex-direction: column;
      flex-direction: column;
      margin-right: 0;
  } 
  .intro {
      -webkit-order: 2;
      -ms-flex-order: 2;
      order: 2;
      margin-top: 2em;
  }
  .social {
      -webkit-order: 3;
      -ms-flex-order: 3;
      order: 3;
      margin-top: 1em;
  }
  .newsletter {
      -webkit-order: 0;
      -ms-flex-order: 0;
      flex-order: 0;
      margin-bottom: 1em;
  }
  .events {
      -webkit-order: 1;
      -ms-flex-order: 1;
      flex-order: 1;
  }
  /* -------------------------------------------------- 
     spotlight content styles
  -----------------------------------------------------*/
  .spotlight {
      -webkit-flex-direction: column;
      -ms-flex-direction: column;
      flex-direction: column;
  }
  .news {
      -webkit-order: 1;
      -ms-flex-order: 1;
      order: 1;
  }
  .course {
      -webkit-order: 0;
      -ms-flex-order: 0;
      order: 0;
  }
  .review {
      -webkit-order: 2;
      -ms-flex-order: 2;
      order: 2;
  }
  
  
  }
  </code></pre>