title: How to center-align one flex item and right-align another using Flexbox
body: <p>I am totally new to Flexbox and wanted to align buttons, but I could not see how to handle the common case with a center-aligned button and a right-aligned button on the same row using only Flexbox.</p>
  <p>However, I found a way that used an invisible left-aligned item of the same length as the right-aligned item and the flex <code>justify-content</code> with <code>space-between</code> to make the middle item centered on the row.</p>
  <p>Is there a more direct way with Flexbox?</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.flexcontainer {
    display: flex;
    justify-content: space-between;
    width: 500px;
    height: 200px;
  }
  
  .iteminvisible {
    flex: 0 1 auto;
    width: 100px;
    height: 100px;
    visibility: hidden;
  }
  
  .itemcenter {
    flex: 0 1 auto;
    width: 150px;
    height: 100px;
  }
  
  .itemright {
    flex: 0 1 auto;
    width: 100px;
    height: 100px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="flexcontainer"&gt;
    &lt;div class="iteminvisible"&gt;Other&lt;/div&gt;
    &lt;div class="itemcenter"&gt;One&lt;/div&gt;
    &lt;div class="itemright"&gt;Other&lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>