0
0
CSSmarkup~10 mins

Grid template areas in CSS - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define a grid container with three columns.

CSS
display: grid;
grid-template-columns: [1];
Drag options to blanks, or click blank then click option'
A1fr 1fr 1fr
Brepeat(2, 1fr)
C100px 100px
Dauto auto
Attempts:
3 left
💡 Hint
Common Mistakes
Using only two columns instead of three.
Using fixed pixel sizes instead of flexible fractions.
2fill in blank
medium

Complete the code to define grid template areas with a header and main content side by side.

CSS
grid-template-areas: "header [1]";
Drag options to blanks, or click blank then click option'
Asidebar
Bheader
Cfooter
Dmain
Attempts:
3 left
💡 Hint
Common Mistakes
Repeating the same area name twice.
Using an area name not defined in the grid.
3fill in blank
hard

Fix the error in the grid-template-areas definition to create a header spanning two columns.

CSS
grid-template-areas:
  "header header"
  "[1] content";
Drag options to blanks, or click blank then click option'
Amain
Bfooter
Csidebar
Dheader
Attempts:
3 left
💡 Hint
Common Mistakes
Repeating 'header' in the second row.
Using an undefined area name.
4fill in blank
hard

Fill both blanks to create a grid with header spanning all columns and footer below spanning all columns.

CSS
grid-template-areas:
  "[1] [1] [1]"
  "main main sidebar"
  "[2] [2] [2]";
Drag options to blanks, or click blank then click option'
Aheader
Bcontent
Cfooter
Dsidebar
Attempts:
3 left
💡 Hint
Common Mistakes
Using different area names in the same row.
Not repeating the area name three times to span all columns.
5fill in blank
hard

Fill all three blanks to create a grid with a header spanning two columns, a sidebar on the left, and content on the right.

CSS
grid-template-areas:
  "[1] [1] [2]"
  "[3] [3] [2]";
Drag options to blanks, or click blank then click option'
Aheader
Bsidebar
Ccontent
Dfooter
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up sidebar and content positions.
Not repeating area names correctly to span columns.