title: How to re-size container to fit width of its children
body: <p>I have two squares inside of a container that are overlapping using transform: translate and I want to remove the padding to the right of the blue square so that the container perfectly fits the width of the children. Please see image for clarification. </p>
  
  <p><a href="https://i.stack.imgur.com/PYiMg.png" rel="nofollow noreferrer">Picture of issue</a></p>
  
  <p>I’ve tried sizing the container to <code>90px</code>, which should be the width of the children <code>(50px + 50px - 10px)</code>, but when I do this the blue box drops to the next row. Why does it do this? I also tried applying <code>padding-right: 0</code> but nothing changed.</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-css lang-css prettyprint-override"><code>.container {
    width: 110px;
    border: 1px solid black;
  }
  
  .box {
    height: 50px;
    width: 50px;
    display: inline-block;
  }
  
  .one {
    background: red;
  }
  
  .two {
    background: blue;
    transform: translate(-10px, 15%);
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="container"&gt;
    &lt;div class="box one"&gt;&lt;/div&gt;
    &lt;div class="box two"&gt;&lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I would like there to be no left or right padding.</p>