<div class="container container--1">
  <div class="item">1</div>
  <div class="item">2</div>
  <div class="item">3</div>
</div>
<br>
<div class="container container--2">
  <div class="item">1</div>
  <div class="item">2</div>
  <div class="item">3</div>
</div>
<br>
<div class="container container--3">
  <div class="item">1</div>
  <div class="item">2</div>
  <div class="item">3</div>
</div>
/* -------- Skip this base code -------- */
* { box-sizing: border-box; } .container { display: grid; gap: 1px; padding: 1px; border: 16px solid silver; color: white; } .item { padding: 8px; background: coral; }

.container--1 { grid-template-areas: '. . .'; }
.container--2 { grid-template-columns: 1fr 1fr 1fr; }
.container--3 { grid-template-columns: repeat(3, 1fr); }

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.