Complete the code to create a grid container with 3 columns.
.container {
display: grid;
grid-template-columns: [1];
}flex instead of grid for display.The grid-template-columns property defines the number of columns in a grid. Using repeat(3, 1fr) creates 3 equal columns.
Complete the code to create 4 rows each 100 pixels tall.
.container {
display: grid;
grid-template-rows: [1];
}repeat(2, 100px) which creates only 2 rows.auto which sizes rows automatically.The grid-template-rows property sets the height of each row. Writing 100px 100px 100px 100px creates 4 rows each 100 pixels tall.
Fix the error in the code to properly define 2 columns and 3 rows.
.container {
display: grid;
grid-template-columns: [1];
grid-template-rows: repeat(3, 50px);
}repeat(3, 1fr) which creates 3 columns instead of 2.The code needs 2 columns, so repeat(2, 1fr) correctly creates 2 equal columns.
Fill both blanks to create a grid with 3 columns and 2 rows, each column 1fr and each row 150px tall.
.container {
display: grid;
grid-template-columns: [1];
grid-template-rows: [2];
}repeat(3, 1fr) creates 3 equal columns. repeat(2, 150px) creates 2 rows each 150 pixels tall.
Fill all three blanks to create a grid with 4 columns of 1fr, 3 rows of 100px, and a gap of 10px between rows and columns.
.container {
display: grid;
grid-template-columns: [1];
grid-template-rows: [2];
gap: [3];
}repeat(4, 1fr) creates 4 equal columns. repeat(3, 100px) creates 3 rows each 100 pixels tall. gap: 10px adds space between rows and columns.