โ† Lessons BUILDER PATH

๐Ÿค– Robot Grid Builder

Lesson 42
โšก โšก โšก โšก โšก โšก โœฆ โœฆ ๐Ÿค–
Themed Universe
Robot Factory
Gears, circuits, and bots โ€” today you learn to arrange your robots in a CSS Grid like a real factory layout! โš™๏ธ

๐Ÿค– What we're building today: My Robot Factory Grid

In Poster Studio and Flex Layout you learned how to arrange things in a row with Flexbox. Today you learn an even stronger superpower: CSS Grid! ๐Ÿ—๏ธ

What's a grid? Think of a tray of cupcakes โ€” it has rows and columns that keep everything neatly in place. CSS Grid does the same for your webpage: it creates a 2D layout where you decide how many columns and how much space between them! Change one number and your whole layout rearranges like magic! ๐Ÿช„

๐Ÿ”— In Flex Layout you used display: flex to arrange things in a line. Today display: grid gives you rows AND columns โ€” a whole 2D grid of robot goodness! โš™๏ธ
๐ŸŽฏ Missions Day โœฆ
โ€ฆ
โ€ฆ
โ€ฆ
โ— โ— โ— robot-grid.css CSS

  
factory grid preview LIVE

๐Ÿค– Robot Factory Step 1 of 5

โ€ฆ

๐Ÿ’ก Hint: โ€ฆ

๐Ÿค– Robot Grid Builder

In Poster Studio you made a poster with CSS. In Flex Layout you arranged things in a row. Today you level up with CSS Grid โ€” the most powerful layout tool! ๐Ÿ—๏ธ

โš™๏ธ CSS Grid Toolkit
display: grid; /* โšก turns on the grid! */
grid-template-columns: repeat(3, 1fr); /* 3 equal columns */
gap: 12px; /* space between items */
 
/* grid-template-columns = HOW MANY columns (repeat(2) = 2 cols) */
/* 1fr = "one fraction" โ€” each column gets equal space */
/* gap = breathing room between robots ๐Ÿค– */
Change ONE number โ†’ the whole grid rearranges! โœจ
๐Ÿ—๏ธgrid is like a box of chocolates โ€” rows AND columns! Change the column count and watch the robots rearrange!
โœ๏ธEdit the teal boxes in the code โ†’ the grid updates live! Hit โœ“ Check after each step.
๐Ÿ‘€Watch how the grid-info below the preview tells you exactly what CSS properties are active!