<div class="container">
  <p>When you turn something into a grid container, you can set grid properties, including column definitions. They let you have ratios in your design, without worries about percentages.</p>
</div>

<ul class="container grid">
  <li>1fr</li>
  <li>3fr</li>
  <li>2fr</li>
  <li>1fr</li>
</ul>

<div class="container">
  <p>Use any numbers you'd like:</p>
</div>

<ul class="container grid grid--weirder-numbers">
  <li>1.53fr</li>
  <li>2.3fr</li>
  <li>6.2fr</li>
  <li>4.2fr</li>
</ul>
* {
  margin: 0;
  padding: 0;
  list-style: none;
}

.container {
  max-width: 50em;
  margin: 2em auto;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 3fr 2fr 1fr;  
  text-align: center;
}
  .grid :nth-child(1) {
    background-color: hotpink;
  }
  .grid :nth-child(2) {
    background-color: gold;
  }
  .grid :nth-child(3) {
    background-color: slategrey;
    color: white;
  }
  .grid :nth-child(4) {
    background-color: lightblue;
  }

.grid--weirder-numbers {
  grid-template-columns: 1.53fr 2.3fr 6.2fr 4.2fr;
}
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.