Skip to content
Justice Tech School

Grid Tracks, fr and minmax

grid-template-columns defines tracks. fr shares free space, repeat() avoids repetition and minmax() sets limits.

Example
<style>
.g { display: grid; grid-template-columns: repeat(3, minmax(40px, 1fr)); gap: 6px } .g div { background: #0f766e; padding: 8px; text-align: center }
</style>
<div class="g"><div>1</div><div>2</div><div>3</div></div>

Exercise

Three equal columns.

grid-template-columns: (3, 1fr);

Quiz Test

What does minmax set?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.