Lesson 23 of 3077%

(Progress persistence is disabled until Phase 9)

Tailwind CSS
Beginner

Grid Columns and Rows

Defining grid tracks.

Use grid-cols-{n} to create columns of equal width.

<div class="grid grid-cols-3 gap-4">
  <div class="bg-red-200 p-4">Col 1</div>
  <div class="bg-green-200 p-4">Col 2</div>
  <div class="bg-blue-200 p-4">Col 3</div>
</div>

You can span multiple columns using col-span-{n} on the children.

Try It Yourself

Lesson Progress

Ready to practise?

Apply what you learned with a hands-on challenge.

Practise This Topic