Overview
Control how flex items are aligned within a flex container. Use justify-content for horizontal alignment and align-items for vertical alignment.Justify Content
Control horizontal alignment of flex items.Justify Content
.justify-start | Start | justify-content: start; | Align to start |
.justify-center | Center | justify-content: center; | Center alignment |
.justify-end | End | justify-content: end; | Align to end |
.justify-between | Space between | justify-content: space-between; | Space between items |
Align Items
Control vertical alignment of flex items.Align Items
.items-start | Start | align-items: start; | Align to start |
.items-center | Center | align-items: center; | Center alignment |
.items-end | End | align-items: end; | Align to end |
.items-stretch | Stretch | align-items: stretch; | Stretch to fill |
Align Self
Control individual item alignment.Align Self
.self-center | Center | align-self: center; | Center this item |
.self-start | Start | align-self: start; | Align to start |
.self-end | End | align-self: end; | Align to end |
Examples
Centered Content
Header with Space Between
Vertical Center
Individual Item Alignment
Common Patterns
Navigation Bar
Card with Icon
Best Practices
- Center content: Use
items-center justify-centerfor centered layouts - Space between: Use
justify-betweenfor header navigation - Vertical alignment: Use
items-centerto vertically center items in a row - Individual control: Use
self-*utilities to override container alignment

