title: How to stop flex from stretching to 100% width?
body: <p>I have a section with 2 columns pulled to center in flexbox, but for whatever reason the container doesn't wrap itself around them horizontally and instead fills the whole page.</p>
  
  <p>What can I do to make the section wrap around the text (with expected padding of 1rem)?</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>body {
    background-color: #444;
    color: white;
  }
  
  section {
    border-style: solid;
    border-image: linear-gradient(to top right, goldenrod 0%, transparent 25%, transparent 75%, goldenrod 100%) 2;
    display: flex;
    padding: 1rem;
    justify-content: center;
    align-items: center;
    width: auto;
  }
  
  section&gt;div {
    display: flex;
    flex-direction: column;
  }
  
  section&gt;div:first-child {
    border-right: 2px solid goldenrod;
    padding-right: 1rem;
    align-items: flex-end;
  }
  
  section&gt;div:not(:first-child) {
    padding-left: 1rem;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;section&gt;
    &lt;div&gt;
      &lt;p&gt;Line First&lt;/p&gt;
      &lt;p&gt;Line Second&lt;/p&gt;
    &lt;/div&gt;
    &lt;div&gt;
      &lt;p&gt;Line First&lt;/p&gt;
      &lt;p&gt;Line Second&lt;/p&gt;
    &lt;/div&gt;
  &lt;/section&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>JSFiddle:
  <a href="https://jsfiddle.net/mjp1qozs/3/" rel="nofollow noreferrer">https://jsfiddle.net/mjp1qozs/3/</a></p>