Play CSS Grid Carrot Patch Online Free

Learn CSS grid by writing rules that drop water on carrots and poison on weeds in a small garden, over 28 levels.

CSS Grid Carrot Patch title screen on SZ Games
  • Touch ready

Tip: rotate your phone to landscape so the play area gets wider.

CSS Grid Carrot Patch is a coding game that teaches CSS grid through gardening. The garden is a five-by-five plot of soil, and some squares hold carrots or weeds. You write CSS to place a patch of water on the carrots or poison on the weeds. The garden is a real grid container, so the patch moves the moment you type.

Why a Garden Helps

Grid layout is all about lines and spans, and those are hard to picture from text alone. Here you see the result of each value right away. Type a number and the patch jumps. Change a span and it stretches. That quick feedback makes the rules stick.

Working Through a Level

Each level has a short lesson, a code box and the garden. Most of the stylesheet is already there. You add the missing lines.

When your patch covers exactly the right squares, the Next button lights up. Press it, and the plants you treated change to their finished look. Then the next level loads. Some levels have two patches at once, and they can overlap.

How to Control CSS Grid Carrot Patch

Input guide for CSS Grid Carrot Patch
To do thisOn a keyboardWith a mouseOn a touchscreen
Write CSSType into the code box—Tap the code box to bring up the on-screen keyboard
Send in a correct answerPress Enter on the final line, or Ctrl + EnterHit "Next" when it lights upTap "Next" on screen
Choose a level—Click the level counter and then a number, or use the arrows at the sidesTap the level counter and then a number
Learn about a property—Hover over a highlighted property name in the instructions—

What the 28 Levels Cover

The early levels use one property at a time:

  • grid-column-start and grid-column-end to set where a patch begins and ends.
  • Negative line numbers that count from the right edge.
  • span to give a width instead of an end line.

Next, the shorthands grid-column and grid-row combine start and end, and grid-area sets all four lines in one go. The order property then rearranges items that are placed automatically.

The final stretch changes the grid itself with grid-template-columns, grid-template-rows and grid-template. You also meet percentages, pixels, ems, repeat() and fr units. Solving the last level shows a short win screen.

Tips for Clean Answers

  • Count lines, not cells. Columns 2 to 4 run from line 2 to line 5, so you write grid-column: 2 / 5.
  • Use span for known sizes. grid-column-end: span 3 covers three cells from the start line.
  • Learn the grid-area order. It goes row start, column start, row end, column end.
  • Think of fr as shares. In 1fr 5fr, fixed sizes come first and the rest splits into six parts.
  • Point at highlighted words. They show which values each property accepts.

Devices and Who It Suits

This game is a good next step after selector practice in CSS Diner. It suits students, new web developers and anyone curious about layout. On narrow screens the garden and editor stack in one column, and you type with the on-screen keyboard. The property tips need a pointer, so a computer is the most comfortable choice.

Last played and checked by SZ Games:

CSS Grid Carrot Patch – Questions and Answers

Do I have to type the exact answer from the hint?

No. The game checks the result, not your wording. If every carrot has water and every weed has poison, with each patch matching its plant exactly, the level is solved.

Why does -1 mean the last line?

Grid lines can be counted from either side. Positive numbers start at the left or top edge, while negative numbers start from the right or bottom, so -1 is always the final line.

Which properties does it teach?

It covers grid-column-start and grid-column-end, span, the grid-column, grid-row and grid-area shorthands, and order. The last levels use grid-template-columns, grid-template-rows and grid-template.

Is my work saved?

Yes. Your level, typed answers and solved levels stay in your browser. Use Reset in the level menu to clear them.

Try Something Different