Complete the code to define a grid container with 3 equal columns.
.grid-container {
display: [1];
grid-template-columns: repeat(3, 1fr);
}The display: grid; property creates a grid container, enabling grid layout.
Complete the code to set the gap between grid rows and columns to 1rem.
.grid-container {
display: grid;
grid-gap: [1];
}The grid-gap property sets the space between rows and columns. Using 1rem sets a consistent gap relative to the root font size.
Fix the error in the code to create a grid with 4 columns each 100px wide.
.grid-container {
display: grid;
grid-template-columns: repeat([1], 100px);
}The repeat(4, 100px) function creates 4 columns each 100 pixels wide.
Fill both blanks to create a grid with 2 columns: first 150px wide, second fills remaining space.
.grid-container {
display: grid;
grid-template-columns: [1] [2];
}The first column is fixed at 150px. The second column uses 1fr to fill the remaining space.
Fill all three blanks to create a grid with 3 rows: 100px, flexible, and 2 times flexible.
.grid-container {
display: grid;
grid-template-rows: [1] [2] [3];
}The first row is fixed at 100px. The second row takes one fraction of remaining space, and the third row takes two fractions, making it twice as tall as the second.