Exercises

CSS Grid Layout: Tracks, Placement, and Alignment

Assess your practical understanding of CSS Grid Layout through 17 questions covering grid containers, rows and columns, fractional units, gaps, responsive track sizing, explicit and implicit grids, item placement, alignment, named areas, dense packing, overlapping items, subgrid, and accessibility. The quiz combines foundational concepts with intermediate and advanced scenarios useful for building modern web interfaces.

Answer the questions below and check the explanation for each answer.

0/17 answered

  1. 1

    Which declaration turns an element into a block-level grid container?

  2. 2

    Which declaration creates three equal-width grid columns?

  3. 3

    Which CSS property adds consistent spacing between both grid rows and grid columns?

  4. 4

    In the illustrated grid, what are the three vertical track regions called?

    Question 4
  5. 5

    A grid item uses grid-column: 1 / 3. How many columns does it span in the illustrated four-line grid?

    Question 5
  6. 6

    In grid-template-columns: 240px 1fr 2fr, how is the remaining available width divided after the fixed track is accounted for?

  7. 7

    Which track definition creates a column that should not shrink below 200px but can expand to share available space?

    Question 7
  8. 8

    When used with repeat() for a responsive grid, how does auto-fit differ from auto-fill when there are fewer items than available tracks?

  9. 9

    The highlighted item starts at vertical grid line 2 and ends at line 4. Which declaration produces this placement?

    Question 9
  10. 10

    What does a period represent inside a grid-template-areas string?

    Question 10
  11. 11

    Which property aligns all grid items within their own grid areas along the block axis?

  12. 12

    In the default horizontal writing mode, which property aligns grid items within their cells from left to right along the inline axis?

  13. 13

    Two grid items overlap as illustrated. Which property most directly controls which item is painted on top?

    Question 13
  14. 14

    A grid explicitly defines two columns, but an item is placed using grid-column: 4. What can CSS Grid create to accommodate it?

  15. 15

    Which declaration enables auto-placement to backfill earlier holes with later items that fit?

    Question 15
  16. 16

    What is the defining behavior of subgrid when applied to a nested grid's columns?

    Question 16
  17. 17

    Why should developers avoid relying on CSS Grid placement to create a visual order that differs greatly from the HTML source order?

Download the App now to have access to + 5000 free courses, exercises, certificates and lots of content without paying anything!

  • 100% free online courses from start to finish

    Thousands of online courses in video, ebooks and audiobooks.

  • More than 60 thousand free exercises

    To test your knowledge during online courses

  • Valid free Digital Certificate with QR Code

    Generated directly from your cell phone's photo gallery and sent to your email

Cursa app on the ebook screen, the video course screen and the course exercises screen, plus the course completion certificate