<div class="wrapper">
  <ul class="auto-grid">
    <li>Item 1</li>
    <li>Item 2</li>
    <li>Item 3</li>
    <li>Item 4</li>
    <li>Item 5</li>
    <li>Item 6</li>
    <li>Item 7</li>
    <li>Item 8</li>
    <li>Item 9</li>
    <li>Item 10</li>
    <li>Item 11</li>
    <li>Item 12</li>
  Set the minimum item size with `--auto-grid-min-size` and you'll
  get a fully responsive grid with no media queries.
.auto-grid {
  --auto-grid-min-size: 16rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--auto-grid-min-size), 1fr));
  grid-gap: 1rem;

  A utility with a max width that contains child elements and horizontal centers them
.wrapper {
  max-width: 65rem;
  margin: 0 auto;
  padding: 0 1rem;

/* Presentational styles */

body {
  background: #efefef;
  padding: 1rem 0;
  line-height: 1.4;
  font-family: sans-serif;

li {
  padding: 5rem 1rem;
  text-align: center;
  font-size: 1.2rem;
  background: #be2edd;
  color: #ffffff;

External CSS

  1. https://codepen.io/andybelldesign/pen/Ygmwym.css

External JavaScript

This Pen doesn't use any external JavaScript resources.