Back to the catalog

Guess the CSS: flexbox and grid edition

20 questions

Each Question shows a rendered layout. Can you tell which CSS produced it? Every picture is drawn from box sizes measured in a real browser. You'll work through the main axis versus the cross axis, flex: 1 versus flex: auto, fr versus %, grid-auto-flow: dense, and why margin: auto centers in some layouts but not others.

Questions

  1. Not answered. Which declaration on .row produced this layout?
  2. Not answered. Which declaration on .stack produced this layout?
  3. Not answered. Which declaration on .row distributed the space like this?
  4. Not answered. Which declaration on .tags packed both rows at the top?
  5. Not answered. Which declaration produced these gutters?
  6. Not answered. Which declaration, applied to every item, made the three items equal?
  7. Not answered. Which declarations, applied to every item, render exactly these widths?
  8. Not answered. How wide does .b render, in px?
  9. Not answered. Why won't .main shrink to the 400px that's left?
  10. Not answered. Which grid-template-columns value made the grid overflow by 20px?
  11. Not answered. Which grid-template-columns values render exactly these column widths?
  12. Not answered. The author wanted two equal columns. Which grid-template-columns value gave this 400 / 200 split instead?
  13. Not answered. Which grid-template-columns value stretched two items across the whole row?
  14. Not answered. Which declaration on .board moved the whole grid to the center?
  15. Not answered. Which declaration produced this placement?
  16. Not answered. Add grid-auto-flow: dense. Which item moves into the empty cell?
  17. Not answered. margin: auto centered the box horizontally but left it at the top. Why?
  18. Not answered. Which single declaration on .box centers it in both directions?
  19. Not answered. Which declaration pushed item 4 to the far right while items 1 to 3 stayed on the left?
  20. Not answered. Which parent setups make margin: auto center this box in both directions?