Order

Utilities for controlling the order of flex and grid items.

The order utilities to change the visual order of specific flex items. We only provide options for making an item first or last, as well as a reset to use the DOM order.

Quick reference

ClassProperties
.order-0order: 0;
.order-1order: 1;
.order-2order: 2;
.order-3order: 3;
.order-4order: 4;
.order-5order: 5;
.order-6order: 6;
.order-firstorder: -9999;
.order-lastorder: 9999;

Basic usage

Ordering flex and grid items

Use order-{order} to render flex and grid items in a different order than they appear in the DOM.

01
02
03
<div class="d-flex justify-content-between">
  <div class="order-3">01</div>
  <div class="order-2">02</div>
  <div class="order-1">03</div>
</div>

To last

Use order-last to render flex and grid items in the last than they appear in the DOM.

01
02
03
<div class="d-flex justify-content-between">
  <div class="order-last">01</div>
  <div>02</div>
  <div>03</div>
</div>

Breakpoints

All flex direction utilities that supports responsive at specific breakpoints, from xs to xxl, have no breakpoint abbreviation in them.

The responsive classes are named using the format order-{breakpoint}-{order}.

For example, use order-md-last to apply the order-last utility at only medium screen sizes and above.

<div class="order-first order-md-last">
  <!-- ... -->
</div>