Flex
Flexbox utilities. Activate with d-flex or d-inline-flex.
Direction
Class
flex-direction
flex-rowrowflex-colcolumnWrap
Class
flex-wrap
flex-wrapwrapflex-nowrapnowrapflex-wrap-reversewrap-reverseJustify content
Class
justify-content
justify-startflex-startjustify-endflex-endjustify-centercenterjustify-betweenspace-betweenjustify-aroundspace-aroundjustify-evenlyspace-evenlyAlign items
Class
align-items
items-startflex-startitems-endflex-enditems-centercenteritems-baselinebaselineitems-stretchstretchLegacy aliases (align-items)
These classes work but items-* is preferred:
Class
align-items
align-startflex-startalign-centercenteralign-endflex-endalign-baselinebaselinealign-stretchstretchAlign self
Class
align-self
self-startflex-startself-endflex-endself-centercenterself-baselinebaselineself-stretchstretchAlign content
Class
align-content
content-startflex-startcontent-endflex-endcontent-centercentercontent-betweenspace-betweencontent-aroundspace-aroundOrder
Class
order
order-1 … order-121 … 12Grow and shrink
Class
Property
Value
grow-0flex-grow0grow-1flex-grow1shrink-0flex-shrink0shrink-1flex-shrink1Responsive variants
All classes support responsive prefixes:
html
<div class="d-flex flex-col md:flex-row">
Column on mobile, row on tablet
</div>Examples
html
<!-- Center content -->
<div class="d-flex justify-center items-center" style="height: 100px">
Centered
</div>
<!-- Space between nav items -->
<nav class="d-flex justify-between items-center pa-4">
<span>Logo</span>
<span>Menu</span>
</nav>
<!-- Wrapping columns -->
<div class="d-flex flex-wrap gap-4">
<div class="grow-1">Column 1</div>
<div class="grow-1">Column 2</div>
<div class="grow-1">Column 3</div>
</div>
<!-- Fixed sidebar, flexible content -->
<div class="d-flex">
<div class="shrink-0" style="width: 200px">Sidebar</div>
<div class="grow-1">Content</div>
</div>