<header>
<h1>Fractions of fractions</h1>
<p>The sum of our flex factors is less than 1, so our grid items take up the equivalent proportion of the leftover space and do not expand to fill it.</p>
</header>
<div class="grid">
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
</div>
* {
box-sizing: border-box;
}
body {
margin: 0;
}
header {
padding: 1rem;
}
.grid {
display: grid;
grid-template-columns: repeat(3, 0.2fr);
grid-template-rows: 300px;
column-gap: 40px;
}
.item {
background-color: blue;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.