--- url: "https://www.w3.org/WAI/WCAG22/Techniques/css/C31" titulek: "C31: Using CSS Flexbox to reflow content | WAI | W3C" h1: "Technique C31:Using CSS Flexbox to reflow content" popis: "" jazyk: "en" kanonicka: "" drobecky: [] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-14 05:31:48" znaku: 4580 slov: 686 kodovani: "utf-8" sha256: "bdc2196f6cf9ba4ddc715046d4a590fb5c327440302146642ff2b50d754e0aa4" --- # Technique C31:Using CSS Flexbox to reflow content ## About this Technique This technique relates to [1.4.10 Reflow](https://www.w3.org/WAI/WCAG22/Understanding/reflow) (**Sufficient**). This technique applies to content using technologies that support [CSS](https://www.w3.org/TR/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. [Flexbox layouts](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_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 zoom preferences. The basic principles of flexbox layouts are to: 1. Define the size of layout regions using flexbox 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 flexbox container as a row of adjacent flexbox items, which may wrap to new rows as needed in much the same way as words in a paragraph wrap. Note Flexbox has the possibility to cause a keyboard navigation disconnect by using the order and reverse properties. The [CSS Flexible Box Layout module warns](https://www.w3.org/TR/css-flexbox-1/#order-accessibility) against resequencing content logic as they cause incorrect source ordering and are non-conforming. ## Examples ### Example 1: Medium complex flexbox layout in HTML and CSS The following medium complex example uses HTML and CSS to create a flexbox 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 percent sizes for the flex items by using the "flex-basis" property and are laid out in source order. ```