CSS layout has changed more in the last few years than in the decade before. Grid, subgrid, container queries and :has() now work in every major browser, so layouts that once needed JavaScript or nested wrappers take a few lines of CSS. This course teaches modern layout from first principles, so you can build responsive pages confidently and understand why they work.
What you'll learn
- The box model, normal flow and how sizing really works
- Flexbox for one-dimensional layouts: alignment, wrapping,
gapand flexible sizing - CSS Grid for two-dimensional layouts: tracks,
frunits, areas and auto-placement - Responsive grids with
repeat(),auto-fitandminmax()without media queries - Subgrid for aligning content across cards and nested components
- Container queries and container query units for components that adapt to their space
- Fluid type and spacing with
clamp()and viewport units - Logical properties for layouts that work in any writing direction
- Selecting by context with
:has(), and organising styles with cascade layers - Debugging layouts with browser DevTools grid and flex inspectors
Who it's for
- Beginners who know basic HTML and CSS and want to build real layouts
- Developers who still rely on floats, frameworks or trial and error for layout
- Designers who want to understand what is possible in the browser today
Prerequisites
- Basic HTML and CSS: selectors, properties and the idea of the box model (see HTML & CSS Fundamentals: Build Your First Websites)
- A modern browser and a code editor
Outcomes
By the end of this course you will be able to:
- Choose between Flexbox and Grid for any layout problem.
- Build responsive page layouts and components with little or no media query code.
- Create components that adapt to their container using container queries.
- Debug layout issues quickly with browser DevTools.
Course outline
| Module | Topic |
|---|---|
| 1 | Normal flow, the box model and sizing |
| 2 | Flexbox fundamentals and alignment |
| 3 | Flexbox patterns: navbars, media objects and wrapping |
| 4 | CSS Grid: tracks, lines and areas |
| 5 | Responsive grids with auto-fit and minmax() |
| 6 | Subgrid and aligning nested content |
| 7 | Media queries and mobile-first design |
| 8 | Container queries and container units |
| 9 | Fluid typography and spacing with clamp() |
| 10 | Logical properties, :has() and cascade layers |
| 11 | Debugging and browser DevTools |
| 12 | Project: a responsive landing page and component set |
FAQ
Do I need a CSS framework?
No. This course uses plain CSS. Frameworks like Tailwind are useful, but they are easier to use well once you understand layout itself. Tailwind CSS in Practice is a good next step.
Are container queries safe to use now?
Yes. Size container queries are supported in all current major browsers. We also show how to check support for newer features before relying on them.
Will this help with accessibility?
Yes. We cover how visual order and source order interact, and why layout should not change the meaning of your content.
How do I join?
Get in touch and we'll share the current format, schedule and enrolment details.