Complete the code to create a grid container with 3 columns.
.grid-container {
display: [1];
grid-template-columns: repeat(3, 1fr);
gap: 1rem;
}The display: grid; property creates a grid container that allows you to define rows and columns.
Complete the code to set a breakpoint for screens smaller than 600px.
@media (max-width: [1]) { .grid-container { grid-template-columns: 1fr; } }
The breakpoint is set at 600px to apply styles for screens smaller than 600 pixels wide.
Fix the error in the Sass mixin to apply grid columns at a breakpoint.
@mixin grid-breakpoint($columns) {
@media (min-width: [1]) {
grid-template-columns: repeat($columns, 1fr);
}
}The media query requires only the value for min-width inside parentheses, so 768px is correct here.
Fill both blanks to create a responsive grid with 2 columns on small screens and 4 on larger screens.
.grid-container {
display: [1];
grid-template-columns: repeat([2], 1fr);
}
@media (min-width: 768px) {
.grid-container {
grid-template-columns: repeat(4, 1fr);
}
}The container must use display: grid; and start with 2 columns on small screens.
Fill all three blanks to create a Sass map for breakpoints and use it in a mixin.
$breakpoints: ( small: [1], medium: [2], large: [3] ); @mixin respond-to($size) { @media (min-width: map-get($breakpoints, $size)) { @content; } }
The map defines breakpoints for small, medium, and large screens using common pixel values.