Order
order property. It controls the visual order of items within a flex container. By default, flex items follow the order in which they appear in the HTML. The order property can change their position without modifying the HTML structure. order property changes the visual order of flex items without altering their order in the HTML. If the visual and reading orders don't match, it can cause confusion for people who use keyboard navigation or screenreaders. Test with assistive technologies to ensure information is clear and accessible.| CSS Shortcut class | Applied style |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Examples
Order 1-12
order-<value>
order property from 1 to 12. For example, the item placed third in the HTML appears visually in second position when given the order-2 class. 1
2
3
<div class="d-flex">
<p class="order-1">1</p>
<p class="order-3">2</p>
<p class="order-2">3</p>
</div> Order first
order-first
order-first class. 1
2
3
<div class="d-flex">
<p>1</p>
<p>2</p>
<p class="order-first">3</p>
</div> Order last
order-last
order-last class. 1
2
3
<div class="d-flex">
<p class="order-last">1</p>
<p>2</p>
<p>3</p>
</div> Order none
order-none
order-none class. 1
2
3
<div class="d-flex">
<p>1</p>
<p class="order-none">2</p>
<p>3</p>
</div> xs:> 480pxsm:> 640pxmd:> 768pxlg:> 1024pxxl:> 1280px
<div class="xs:order-first ...">
...
</div>