Explicit vs Implicit Grid
You'll learn the difference between grid tracks you define directly versus those the browser creates automatically for overflow content.
The Core Idea
When you use CSS Grid, there are two ways grid tracks (rows and columns) can be created:
Explicit grid tracks are the ones you define using properties like grid-template-columns and grid-template-rows. You're explicitly telling the browser: "I want exactly 3 columns of 200px each."
Implicit grid tracks are automatically created by the browser when you place more items than fit in your explicit grid. If you define 3 columns but have 10 items, the browser creates additional rows implicitly to hold the overflow.
How It Works
Think of it like planning a parking lot. The explicit grid is the parking spaces you paint on the ground—you control their exact size and number. The implicit grid is like overflow parking on the grass—the browser adds it automatically when your planned spaces fill up, but you didn't design it in advance.
.container {
display: grid;
grid-template-columns: 100px 100px; /* explicit: 2 columns */
/* No grid-template-rows defined */
}
With 6 items in this container, you explicitly created 2 columns. The browser implicitly creates 3 rows to fit all items—rows you never specified directly.
The implicit grid follows the flow direction (usually rows after you've defined columns), and items get auto-sized unless you control it with other properties.
Key Takeaway: The explicit grid is what you design; the implicit grid is what the browser adds automatically to accommodate extra content.