Responsive Layout with Flexbox & Grid
Build layouts that adapt from small phones to wide screens using flexbox, grid, intrinsic sizing, media queries and container queries.
4 objectives 6 steps about 140 min
Learn it step by step
Read the lessons in order, try the practice checks, then prove the skill with the knowledge check.
This skill page is a public outline. Its lessons and knowledge check appear here as subject-matter experts approve them.
Learning objectives
- Build one-dimensional layouts with flexbox: direction, wrapping, gap, alignment and flex-grow, flex-shrink and flex-basis.
- Build two-dimensional page and component layouts with CSS grid, including named areas, minmax(), auto-fit and subgrid.
- Adapt layout and type mobile-first with fluid sizing (clamp()), media queries, container queries and responsive images (srcset and sizes), checking Baseline support before using a feature.
- Verify a layout at 320, 768 and 1280 px widths and at 200% zoom with no horizontal scrolling, clipped text or overlapping content.
Lesson plan
6 steps, about 140 min · 5 of 5 lessons available so far
- Flexbox for Rows, Columns and Alignment Worked example · 25 min
- Grid for Pages and Card Collections Worked example · 25 min
- Mobile-First with Fluid Sizing, Media and Container Queries Concept · 25 min
- Serving the Right Image with srcset and sizes Concept · 15 min
- Lab: A Product Listing Page Without a Framework Lab · 30 min
- Check: Layout Challenges at Three Viewports Knowledge check · 8 questions
Practise it
Build a responsive product-listing page (header, filter sidebar, card grid, footer) with grid for the page and flexbox inside cards, plus a card that changes layout through a container query; submit screenshots at 320, 768 and 1280 px and at 200% zoom.
References
Hard prerequisites
Unlocks
Nothing depends on this skill yet.
On these roadmaps
Progress and evidence for this skill are shared across all of them.