Practice and reinforce the concepts from Lesson 14
To apply concepts of CSS Grid through an interactive activity.
Checklist:
In this activity, you will learn and practice CSS Grid by playing Grid Garden, a game where you grow a carrot garden using CSS code.
grid-column-start
and grid-column-end
grid-row-start
and grid-row-end
grid-column
(shorthand)grid-row
(shorthand)grid-area
(super shorthand)justify-items
and align-items
justify-content
and align-content
:bulb: Tip Stuck on a level? Don't worry! CSS Grid can be tricky at first. Try these strategies:
grid-column: 2; /* Place in column 2 */
grid-row: 3; /* Place in row 3 */
grid-column: 1 / 4; /* Span from column 1 to 4 */
grid-row: span 2; /* Span 2 rows */
grid-area: 1 / 2 / 3 / 4; /* row-start / col-start / row-end / col-end */
:bulb: Tip Pro tip: The
grid-area
shorthand follows the order: row-start / column-start / row-end / column-end. Remember it as "top, left, bottom, right" - like a clock going counterclockwise from 12!
After completing Level 19, you should be comfortable with:
Carrots not moving where expected?
Confused about span?
span 2
means "take up 2 grid tracks"Grid-area syntax confusing?
After completing the game, answer these questions in your notebook:
:information_source: Time to Submit! Once you've completed Level 19 and your reflection, you're ready to move on to the next concept. Great job mastering CSS Grid!
CSS Grid is the most powerful layout system available in CSS, enabling you to create complex, responsive 2D layouts that were previously impossible or required complex workarounds. Mastering CSS Grid will make you a more effective web developer and enable you to create sophisticated, professional layouts.
Ready to grow your carrot garden? :emoji: Let's start your CSS Grid adventure!