liveBook · Manning

Min-width

As explained in Tiny CSS Projects

The min-width media feature tests whether the viewport or output width is at least a specified value.

The min-width media feature applies CSS when the viewport or output width is at least a specified value. Write it inside a media query, such as @media (min-width: 955px) { }, then place the wider-screen rules inside the braces. section 4.4.1

Use increasing min-width thresholds to add layout changes as more horizontal space becomes available:

  • At 550px and wider, right-align the third and later checkout-table columns with :nth-of-type(n+3). section 8.4.1
  • At 995px and wider, turn the checkout and summary sections into a flex layout with a 20px gap. section 8.5
  • Use flex-grow and flex-basis to influence how the available width is divided between the cart and summary sections. section 8.5

A wide checkout layout

Starting with a .section-container holding the cart and summary sections, apply @media (min-width: 955px) { .section-container { display: flex; gap: 20px; } section.my-cart { flex-grow: 1; } section.summary { flex-basis: 250px; } }. The cards sit side by side when the threshold is reached; at smaller widths, the wide-screen rules do not apply.

Figure 4.18 Media-query breakdown

Inspect the media-query breakdown to connect the @media syntax, min-width condition, and rules that activate when the condition matches. section 4.4.1

How Tiny CSS Projects covers it

How deep it goes
Explains threshold syntax and demonstrates breakpoint-specific alignment and Flexbox layouts, without detailing media-query evaluation internals.
Examples
Uses responsive newspaper columns, checkout-table alignment, and side-by-side cart and summary cards.
What it assumes
Assumes basic HTML and CSS while explaining media-query syntax and responsive layout changes through concrete interfaces.
What you can do after
Apply min-width media queries to progressively adapt table alignment and checkout layouts for wider screens.
How it connects
Connects media queries with responsive web design, Flexbox, :nth-of-type(), flex-grow, flex-basis, and max-width.

Also explained in

Compare how 2 books explain min-width →

Related concepts

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