--- url: "https://www.w3.org/WAI/WCAG22/Techniques/css/C32" titulek: "C32: Using media queries and grid CSS to reflow columns | WAI | W3C" h1: "Technique C32:Using media queries and grid CSS to reflow columns" popis: "" jazyk: "en" kanonicka: "" drobecky: [] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-14 05:31:47" znaku: 4989 slov: 762 kodovani: "utf-8" sha256: "74f9fc6775e2d91e20af5da793478d9e1cb608d2394f9c7f8a3f3b588cd324e7" --- # Technique C32:Using media queries and grid CSS to reflow columns ## About this Technique This technique relates to [1.4.10 Reflow](https://www.w3.org/WAI/WCAG22/Understanding/reflow) (**Sufficient**). This technique applies to CSS. Techniques are examples of ways to meet Web Content Accessibility Guidelines (WCAG). They are **not required** to meet WCAG. Content can satisfy the normative requirements of WCAG even if it does not use any of the documented techniques. See [About WCAG Techniques](https://www.w3.org/WAI/WCAG22/Techniques/about). ## Description The objective of this technique is to be able to present content without introducing a horizontal scroll bar at a width equivalent to 320 CSS pixels, or a vertical scroll bar at a height equivalent to 256 CSS pixels for text intended to scroll horizontally. This is done by using layout techniques that adapt to the available viewport space. [Grid layouts](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Grid_Layout) define layout regions that reflow as needed to display the region on the screen. Although the exact layout therefore varies, the relationship of elements and the reading order remains the same when done right. This is an effective way to create designs that present well on different devices and for users with different content-size preferences. The basic principles of grid layouts are to: 1. Define the size of layout regions using grid properties and media queries for specific viewport sizes, so they enlarge, shrink or wrap in the available space and respond to zoom levels; 2. Position the layout regions in the grid container as a row of adjacent grid items, which may wrap to new rows as needed in much the same way as words in a paragraph wrap. Note Use of grid layout CSS can cause a keyboard navigation disconnect by making the visual layout and source-code order different. The [CSS Grid Layout Module Level 1 warns](https://www.w3.org/TR/css-grid-1/#placement-a11y) against re-ordering content by grid item placement as they cause an incorrect focus order for keyboard users and others. ## Examples ### Example 1: Grid layout in HTML and CSS - Medium complexity The following medium complexity example uses HTML and CSS to create a grid layout. The layout regions adjust their size as the viewport is adjusted. When the total viewport width matches the width defined via media queries, columns wrap to be positioned below, rather than beside each other or vice versa. The zoom level can be increased to 400% without requiring scrolling in more than one direction. This particular example uses fr units as a fraction of the free space of the grid container for the grid items by using the "grid-template-columns" property and are laid out in source order. ```