title: CSS Grid: How do I put everything on a single row?
body: <p>I am trying to use grid more, but I can’t work out what should be a simple question. How do I put all of the elements in a single row?</p>
  
  <p>That is, I want to emulate the <code>flex</code> layout for a single row.</p>
  
  <p>I know I can use <code>grid-template-columns: 1fr 1fr 1fr 1fr;</code> in the example below, but I don’t want to set a specific number of columns.</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>div#flex {
    display: flex;
    flex-direction: row; /* I know that’s not necessary */
  }
  div#flex&gt;button {
    flex: 1;
  }
  
  div#grid {
    display: grid;
    grid-template-rows: 1fr;
  }
  div#grid&gt;button {
  
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="flex"&gt;
    &lt;button&gt;One&lt;/button&gt;
    &lt;button&gt;Two&lt;/button&gt;
    &lt;button&gt;Three&lt;/button&gt;
    &lt;button&gt;Four&lt;/button&gt;
  &lt;/div&gt;
  
  &lt;div id="grid"&gt;
    &lt;button&gt;One&lt;/button&gt;
    &lt;button&gt;Two&lt;/button&gt;
    &lt;button&gt;Three&lt;/button&gt;
    &lt;button&gt;Four&lt;/button&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>