title: CSS Grid - Stretch to fill remaining space
body: <p>I am using CSS grid to create a simple 3 column layout like this...</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 {
    display:grid;
    grid-template-columns:1fr 1fr 1fr;
  }
  
  .col1 {
  background:red;
  text-align:center;
  }
  
  .col2 {
  background:yellow;
  text-align:center;
  }
  
  .col3 {
  text-align:center;
  background:green;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="container"&gt;
  
    &lt;div class="col1"&gt;
      Column 1
    &lt;/div&gt;
  
    &lt;div class="col2"&gt;
      &lt;img src="https://via.placeholder.com/150"&gt;
    &lt;/div&gt;
  
    &lt;div class="col3"&gt;
      Column 3
    &lt;/div&gt;
  
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I am trying to change things so that the center div is only as wide as the image it contains, then <code>col1</code> and <code>col2</code> stretch to fill the remaining space.</p>
  
  <p>Anyone have an example they can show me?</p>