Flex Alignment Utilities: Justify, Items, and Self
Align flex items on both axes in Elementor using AtomicKit’s justify-, items-, self-, and content- utilities with responsive breakpoint support.
AtomicKit provides a complete set of alignment utilities for both the main axis (justify-*) and the cross axis (items-*, self-*, content-*) of flex containers. Together they replace nearly every manual positioning adjustment you would otherwise make in Elementor’s style panel, and all of them support responsive --on-* variants so alignment can shift at any breakpoint.
items-stretch forces all cards in a row to match the height of the tallest card, giving the row a consistent baseline:
<div class="flex items-stretch gap-4 flex-wrap"> <div class="basis-1-3"> <div class="card">Short card content</div> </div> <div class="basis-1-3"> <div class="card">This card has much more text and will be taller than the others by default.</div> </div> <div class="basis-1-3"> <div class="card">Medium length card content here</div> </div></div>
self-* utilities override the parent’s align-items for one specific child. Apply them directly to the child element you want to break from the group.
Class
CSS
Effect
.self-start
align-self: flex-start
Align this item to the start of the cross axis
.self-center
align-self: center
Center this item on the cross axis
.self-end
align-self: flex-end
Align this item to the end of the cross axis
A classic use case is a card row where all cards stretch to equal height, but a single featured badge should pin to the top of its cell:
<div class="flex items-stretch gap-4"> <div>Regular item — stretches to full height</div> <div class="self-start">Featured badge — stays at the top</div> <div>Regular item — stretches to full height</div></div>
content-* utilities control how multiple lines are distributed across the cross axis. They only have a visible effect when the flex container is using .flex-wrap and children have wrapped onto more than one line.
Class
CSS
Effect
.content-start
align-content: flex-start
Pack all lines toward the cross-axis start
.content-center
align-content: center
Center all lines in the cross-axis space
.content-end
align-content: flex-end
Pack all lines toward the cross-axis end
.content-between
align-content: space-between
Spread lines with equal space between them
.content-around
align-content: space-around
Equal space around each line
.content-evenly
align-content: space-evenly
Equal space between all lines and edges
content-* classes have no effect on single-line flex containers. You must combine them with .flex-wrap and a fixed container height for the spacing to be visible.
All alignment utilities support the --on-* suffix. This is useful when center-aligned content on mobile should switch to a space-between layout on wider screens:
<!-- Stacked and centered on mobile, row with between on medium+ --><div class="flex flex-col items-center justify-center flex-row--on-m justify-between--on-m gap-4"> <span>Brand</span> <nav>Navigation</nav></div>
Responsive suffixes are mobile-first: --on-s, --on-m, --on-l, --on-xl. A class without a suffix applies at all viewport sizes and is overridden by any breakpoint-specific class.
justify-* always targets the main axis (the direction children flow). items-* and self-* target the cross axis. Keeping this mental model clear prevents trial-and-error alignment.
Use self-* to break ranks
Rather than wrapping an outlier child in its own container, reach for .self-start, .self-center, or .self-end to nudge it independently while the rest of the group stays consistent.
content-* needs wrap and height
content-* has no effect unless the container both wraps (flex-wrap) and has enough height for the lines to actually spread. Set min-height or height on the container to give the lines room.
Combine justify and items
Centering an element on both axes requires both justify-center and items-center. One class alone centers on only one axis, which is a common source of “almost centered” bugs.