Tailwind CSS · module 4 of 9

Flexbox & Grid

Build one- and two-dimensional layouts with flex direction, alignment, grid columns, spans, and gaps.

Course map
flex-direction: rowmain axis → justify-contentcross axis ↕ align-itemsflex-direction: columnmain axis is vertical nowThe axes swap with the direction — which is why the same justify-content spreads items sideways inone layout and downwards in the other. Learn where the axis points, not the property names.
Flexbox & Grid — the idea in one picture

What this module covers

5 steps · Tailwind CSS

  1. Step 1. Lesson: Flexbox & Grid

    Build one- and two-dimensional layouts with flex direction, alignment, grid columns, spans, and gaps. Learning objectives - Recognize when flexbox & grid is the right tool. - Explain the role of flex, grid, gap-. - Build a small working example before combining it with a larger interface. - Identify one accessibility, maintainability, or error-handling improvement. Read the example, predict what it will do, then complete the small change described in the check question.

    Build one- and two-dimensional layouts with flex direction, alignment, grid columns, spans, and gaps. In HTML + CSS, make the state/interaction visible in the UI so completion is easy to verify.

    Check yourself: [HTML + CSS] Use the example to demonstrate flexbox & grid.

  2. Step 2. Quiz: Flexbox & Grid

    Check your understanding of Flexbox & Grid.

    The grid utility sets display: grid. In HTML + CSS, make the state/interaction visible in the UI so completion is easy to verify.

    Check yourself: [HTML + CSS] Complete the knowledge check.

  3. Step 3. Exercise: Flexbox & Grid

    Build a card row with Flexbox and a responsive content dashboard with Grid.

    This exercise turns the Flexbox & Grid lesson into a working code change. In HTML + CSS, make the state/interaction visible in the UI so completion is easy to verify.

    Check yourself: [HTML + CSS] Does the solution use flex and grid and gap-?

  4. Step 4. Review lab: Explain & improve Flexbox & Grid

    Rebuild the exercise without copying the solution. Then improve it in two ways: make the code easier to understand and add one useful edge case, responsive behavior, accessibility improvement, or error state. Finally, write a short explanation of how flex, grid, gap- work together.

    Rebuilding from memory and improving an edge case turns recognition into durable skill. In HTML + CSS, make the state/interaction visible in the UI so completion is easy to verify.

    Check yourself: [HTML + CSS] Does the improved version still use flex, grid, gap- clearly?

  5. Step 5. Mini project: Flexbox & Grid

    Create a responsive admin dashboard with sidebar, metric cards, table area, and action toolbar.

    The mini project combines the module lesson, quiz, and exercise into one portfolio-ready result. In HTML + CSS, make the state/interaction visible in the UI so completion is easy to verify.

    Check yourself: [HTML + CSS] Does the project apply the module's flexbox & grid skills?

Loading code lab...