GC Design System CSS Shortcuts
Home Start to use Page templates overview Basic page Components overview Breadcrumbs Button Card Checkboxes Container Date input Date modified Details Error message Error summary Fieldset File uploader Footer Grid Header Heading Icon Input Language toggle Link Notice Pagination Radios Screenreader-only Search Select Side navigation Signature Stepper Text Textarea Theme and topic menu Top navigation CSS shortcuts overview Reset styles Responsive layout State Box sizing Container sizing Display Overflow Position Visibility Font Font family Font size Font style Font weight Line height Link colour Link size Link text decoration List style Text align Text colour Text overflow Text transform Word break Margin Padding Align content Align items Align self Flex Flex direction Flex grow Flex shrink Flex wrap Gap Grid columns Grid rows Justify content Justify items Justify self Order Place content Place items Place self Background colour Border colour Border radius Border style Border width Icon names Icon size Image Cursor Pointer events Transition Styles overview Design tokens Colour tokens Spacing tokens Typography tokens Contact us Get involved Find a demo

Flex wrap

The flex wrap class sets the flex-wrap property. It controls how flex items wrap onto multiple lines if there isn’t enough space for them.

In flexbox, the flex-direction property sets the main and cross axis. The effects of flex-wrap change based on the container's direction.

Overview

CSS Shortcut class Applied style
flex-wrap
flex-wrap: wrap;
flex-wrap-reverse
flex-wrap: wrap-reverse;
flex-nowrap
flex-wrap: nowrap;

Examples

Wrap
flex-wrap

These items wrap onto multiple lines or columns when they don’t fit in a single row or column. Wrapping occurs in the default direction based on the cross axis.

In row layouts, it wraps from start to end vertically.
In column layouts, it wraps from start to end horizontally.

1

2

3

<div class="d-flex flex-wrap">
  <p>1</p>
  <p>2</p>
  <p>3</p>
</div>

Reverse wrap
flex-wrap-reverse

These items wrap onto multiple lines or columns when they don’t fit in a single row or column. Wrapping occurs in the reverse direction along the cross axis.

In row layouts, it wraps from end to start vertically.
In column layouts, it wraps from end to start horizontally.

1

2

3

<div class="d-flex flex-wrap-reverse">
  <p>1</p>
  <p>2</p>
  <p>3</p>
</div>

No wrap
flex-nowrap

These items are forced onto one line without wrapping.

1

2

3

<div class="d-flex flex-nowrap">
  <p>1</p>
  <p>2</p>
  <p>3</p>
</div>

Conditional styling Apply this style to specific screen sizes Use a responsive layout prefix to apply this class only to a specified screen size. The available breakpoints are:

  • xs: > 480px
  • sm: > 640px
  • md: > 768px
  • lg: > 1024px
  • xl: > 1280px
  
<div class="xs:flex-wrap ...">
  ...
</div>
  

Learn more about the responsive layout prefix.

2025-10-01