Skip to main content

Justify Content

Set item alignment along a container's main axis.

View as Markdown
baselinewidely
ClassCSS
jc:cjustify-content: center;
jc:fejustify-content: flex-end;
jc:fsjustify-content: flex-start;
jc:njustify-content: normal;
jc:sjustify-content: stretch;
jc:sajustify-content: space-around;
jc:sbjustify-content: space-between;
jc:sejustify-content: space-evenly;

Variants

Prefix any class with a variant to apply it only under that condition. Variants stack, as in @md:h:jc:s.

Breakpoints

Apply a class from a viewport width up. Each breakpoint covers its width & every width above it.

@xs:jc:sFrom 32rem up.
@sm:jc:sFrom 40rem up.
@md:jc:sFrom 48rem up.
@lg:jc:sFrom 64rem up.
@xl:jc:sFrom 80rem up.
@xxl:jc:sFrom 96rem up.

Containers

Apply a class from a container's width up, not the viewport's. Mark the parent with ct:is first.

@c:xs:jc:sContainer from 32rem up.
@c:sm:jc:sContainer from 40rem up.
@c:md:jc:sContainer from 48rem up.
@c:lg:jc:sContainer from 64rem up.
@c:xl:jc:sContainer from 80rem up.
@c:xxl:jc:sContainer from 96rem up.

Media

Apply a class when the device or the page matches a condition, or on the first frame an element renders.

@pc:jc:sOn a touch screen.
@prm:jc:sWith reduced motion on.
@st:jc:sOn the first frame.

States

Apply a class only while the element is in a state, such as hovered, focused or checked.

h:jc:sOn :hover.
f:jc:sOn :focus.
fv:jc:sOn :focus-visible.
a:jc:sOn :active.
d:jc:sOn :disabled.
fc:jc:sOn :first-child.
c:jc:sOn :checked.
e:jc:sOn :empty.
fw:jc:sOn :focus-within.
i:jc:sOn :invalid.
in:jc:sOn :indeterminate.
lc:jc:sOn :last-child.
nc:jc:sOn :nth-child.
r:jc:sOn :required.
ro:jc:sOn :read-only.
v:jc:sOn :valid.

Pseudo Elements

Style a part of the element rather than the element itself, such as its placeholder or the selected text.

a::jc:sOn ::after.
b::jc:sOn ::before.
p::jc:sOn ::placeholder.
s::jc:sOn ::selection.