Stage 1 · Lesson 3 of 8
Flexbox, Grid and responsive layout
Most layouts need two tools. lines items up in one direction, a row or a column. It suits nav bars, toolbars and centring things.
Grid handles rows and columns at the same time. It suits whole page layouts and galleries of cards. For example, repeat(auto-fill, minmax(220px, 1fr)) gives a grid that adapts to any screen with no media queries at all.
Build mobile first. Write the narrow phone layout as the default. Then add min-width media queries (rules that apply from a certain screen width) as the screen grows. Include the , or phones will show a tiny zoomed-out desktop page.
Common trapfixed pixel widths that overflow a 375px phone screen, so test at that width in the browser dev tools.
A question to check yourself, an AI practice session and 1 cheat sheet entry come with the full roadmap. Unlock
Resources for this stage
Start with· follow one of these
- CoursePaidGrokking JavaScript Fundamentals
Design Gurus · Beginner · $50
Guided course on the language core if you want structure and quizzes
- CourseFreeThe Odin Project
The Odin Project · Beginner
Free Foundations course: HTML, CSS and JavaScript built in your own editor
Practise
Keep handy
Also worth your time
The request path from browser to server that the rest of this roadmap builds on