liveBook · Manning

Adaptive layout

As explained in Web Design Playground

A layout strategy that changes its structure or styling at defined breakpoints to suit different screen sizes.

An adaptive layout changes its styling or structure when the screen matches a condition. Think of it like a room that rearranges its furniture: a narrow phone keeps the page simple, while a wider screen can reveal more. section 13.12

Build one in small steps:

  • Start with a mobile-first layout, usually keeping elements stacked and easy to read on a phone. section 13.19
  • Choose a screen feature to test, most often viewport width. section 13.12
  • Write a media query: its expression asks a question, and its code block supplies styles when the answer is true. section 13.12
  • Use max-width for smaller screens and min-width for screens at least as wide as a chosen value. section 13.12
  • Add layout changes for larger screens, such as showing an aside or allowing elements to wrap with flexible layout techniques. section 13.19
@media (expression) { 
selector {
        declarations
    }
    etc.
}

Use this pattern as the basic shape of a CSS media query: test an expression, then apply declarations to matching elements. section 13.12

A page that makes room

Keep the page title comfortable on very narrow screens: @media (max-width: 350px) { h1 { font-size: 24px; } } On a wide screen, reveal the aside: @media (min-width: 1024px) { aside { display: inline-block; } } Between those conditions, the browser simply uses the base layout. section 13.12

Try resizing a page and watch which rules switch on. Then add one gentle change for a wider screen—perhaps a new column, more breathing room, or a visible aside. section 13.19

How Web Design Playground covers it

How deep it goes
Explains media-query logic, min-width and max-width rules, and mobile-first adjustments, while deferring less common media features.
Examples
Uses a narrow-screen h1 rule and a wide-screen aside rule to demonstrate responsive changes.
What you can do after
Apply it via CSS media queries to resize, rearrange, hide, or reveal page elements at chosen screen widths.
How it connects
Connects media queries with liquid layouts, flexbox, inline blocks, and mobile-first design.

Also explained in

Compare how 2 books explain adaptive layout →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Web Design Playground. The section links point to the parts of the book it draws on.