title: After insertAdjacentHTML, some elements are partially shown even if scrolling enabled, how to avoid coverage?
body: <p>Please run the code snippet to understand my question. </p>
  
  <p>after clicking the square for 2 times, the scrollbar is visible. However the left-/right-most square is partially shown, I don't know how to avoid this. </p>
  
  <p>Also want to emphasize that I:</p>
  
  <ol>
  <li><strong>prefer center-aligning</strong> the squares.  </li>
  <li><strong>both horizontal and vertial</strong> insertions are to be implemented.</li>
  </ol>
  
  <p>The final desired outcome / sample output is demonstrated by this GIF:</p>
  
  <p><img src="https://user-images.githubusercontent.com/1609306/61577383-2c766700-ab19-11e9-9ac7-caaab0189ade.gif" alt="."></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function insertElement(ev) {
    let this_node = ev.target;
    this_node.insertAdjacentHTML('afterend', '&lt;div class="square" onclick="insertElement(event);"&gt;&lt;/div&gt;');
  }</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.container {
    display: -webkit-flex;
    justify-content: center;
    width: 100px;
    padding: 20px;
    background-color: #fff280;
    overflow: scroll;
  }
  
  .square {
    min-width: 45px;
    height: 45px;
    margin: 5px;
    background-color: #9c9c9c;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  
  &lt;head&gt;
    &lt;meta charset="utf-8"&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
    &lt;div class="container"&gt;
      &lt;div class="square" onclick="insertElement(event);"&gt;&lt;/div&gt;
    &lt;/div&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>