Skip to main content
Module 7 · Lesson 2 of 426/60 in the course~18 min
Module lessons (2/4)

Wrapping Multi-Row Items & Accessibility Order Caution

Lesson preview5 hands-on exercises readyModern HTML & CSS · Flexbox Layout in Depth

Wrap tag groups gracefully with flex-wrap and align-content while keeping keyboard Tab order aligned with DOM order.

What you'll learn in this lesson

  • Prevent narrow screen overflow in tag bars and action lists using flex-wrap: wrap.
  • Separate align-items (alignment within a single flex line) from align-content (spacing between wrapped flex lines).
  • Understand the accessibility danger of using CSS order on focusable links or buttons.

Overview

By default, display: flex sets flex-wrap: nowrap, trying desperately to squeeze 8 tags onto one single line until items either squish unreadably narrow or punch straight out of the screen on mobile!

Adding flex-wrap: wrap; lets items flow onto new lines cleanly—just like words in a paragraph.

Sections covered in this lesson

  1. 1Wrapping Multi-Line Flex Containers Gracefully
Pro Lesson · Flexbox Layout in Depth

Unlock "Wrapping Multi-Row Items & Accessibility Order Caution" and the full Modern HTML & CSS curriculum

Wrap tag groups gracefully with flex-wrap and align-content while keeping keyboard Tab order aligned with DOM order.

Unlock all 5 hands-on exercises in this lesson plus every advanced WebAssembly module with automated checks.

  • Instant access to all advanced modules in Modern HTML & CSS plus 17 more courses
  • Hands-on browser exercises with automated test suites and solutions
  • 14-day money-back guarantee processed via Paddle.com

14-day guarantee · Cancel anytimeModule 1, all 18 interactive games, and cheatsheets are always free.