Lesson 5 of 16
Flexbox
Flexbox in Tailwind
Apply flexbox with a single class:
<div class="flex items-center justify-between gap-4">
<div>Left</div>
<div>Right</div>
</div>
Direction:
flex-row(default) — horizontalflex-col— verticalflex-row-reverse,flex-col-reverse
Alignment (cross axis):
items-start,items-center,items-end,items-stretch
Justification (main axis):
justify-start,justify-center,justify-endjustify-between,justify-around,justify-evenly
Gap:
gap-4— equal gap in both directionsgap-x-4,gap-y-4— axis-specific
Wrap:
flex-wrap— wrap to next line
Item utilities:
flex-1— grow to fillflex-none— don't grow or shrinkself-center— override alignment for one item
Your Task
Create a flex row with items-center, justify-between, and gap-4 containing 3 colored boxes.
Tailwind preview loading...
Loading...
Click "Run" to execute your code.