Skip to main content

Justify Self

Set individual item alignment along a container's inline axis.

View as Markdown
baselinewidely
ClassCSS
js:autojustify-self: auto;
js:cjustify-self: center;
js:ejustify-self: end;
js:sjustify-self: start;
js:stjustify-self: stretch;

Variants

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

Breakpoints

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

@xs:js:eFrom 32rem up.
@sm:js:eFrom 40rem up.
@md:js:eFrom 48rem up.
@lg:js:eFrom 64rem up.
@xl:js:eFrom 80rem up.
@xxl:js:eFrom 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:js:eContainer from 32rem up.
@c:sm:js:eContainer from 40rem up.
@c:md:js:eContainer from 48rem up.
@c:lg:js:eContainer from 64rem up.
@c:xl:js:eContainer from 80rem up.
@c:xxl:js:eContainer 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:js:eOn a touch screen.
@prm:js:eWith reduced motion on.
@st:js:eOn the first frame.

States

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

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

Pseudo Elements

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

a::js:eOn ::after.
b::js:eOn ::before.
p::js:eOn ::placeholder.
s::js:eOn ::selection.