title: how to align items in the center and right
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.parent {
    display: flex;
    justify-content: flex-end;
    background-color: lightgray;
  }
  
  .child {
    width: 200px;
    height: 200px;
    background-color: gray;
    border: solid black 1px;
  }
  
  .center {
    margin: 0 auto;
    background-color: black
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="parent"&gt;
    &lt;div class="child center"&gt; &lt;/div&gt;
    &lt;div class="child"&gt; &lt;/div&gt;
    &lt;div class="child"&gt; &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  <p><a href="https://i.stack.imgur.com/WrLbu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WrLbu.png" alt="" /></a></p>
  <p>and this is what i've got.</p>
  <p>It seems the black one is located in the a little left, not the &quot;center&quot; of the parent.
  How can i fix this?</p>