CSS Grid
Flexbox arranges items in one direction. Grid arranges them in rows and columns at once, which is ideal for galleries, dashboards and whole page layouts.
.board {
display: grid;
grid-template-columns: 200px 1fr 1fr;
gap: 16px;
}
grid-template-columnslists the width of each column.frmeans "a fraction of the free space":1fr 1fris two equal columns,2fr 1frgives the first twice the space.repeat(4, 1fr)is short for1fr 1fr 1fr 1fr.gapsets the space between rows and columns.
Children fill the cells in order, wrapping onto new rows automatically.
Spanning cells
A child can take up several columns or rows:
.banner {
grid-column: span 3; /* three columns wide */
}
.sidebar {
grid-row: span 2; /* two rows tall */
}
Responsive without media queries
This handy line makes as many columns as fit, each at least 150px wide:
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
Your task
Make .gallery a grid with three equal columns and a 10px gap, and make the .featured item span two columns.