concept

Reflow — CSS reference

Reflow lets content adapt to a narrow viewport without unnecessary two-dimensional scrolling. WCAG 2.2 criterion 1.4.10 (AA) generally uses a 320 CSS pixel equivalent width for vertically scrolling content, with exceptions for content needing two-dimensional layout. Keep source order meaningful and allow controls and long words to wrap. This fixture checks ordinary layout at two widths; supplementary testing uses 320px.

Formal Syntax & Structure

css syntaxcss
grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>reflow</title><style>body{margin:8px;font:16px/1.5 sans-serif;color:black;background:white}#a{box-sizing:border-box}#a{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,14rem),1fr));gap:8px}#a>*{overflow-wrap:anywhere;min-width:0}</style><body><main id="a"><section id="b">Account overview</section><section id="d">Payment details</section></main></body></html>
CSS Reference