Skip to main content

Align Items

Set item alignment along a container's cross axis.

View as Markdown
baselinewidely
ClassCSS
ai:balign-items: baseline;
ai:calign-items: center;
ai:fealign-items: flex-end;
ai:fsalign-items: flex-start;
ai:salign-items: stretch;

Variants

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

Breakpoints

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

@xs:ai:feFrom 32rem up.
@sm:ai:feFrom 40rem up.
@md:ai:feFrom 48rem up.
@lg:ai:feFrom 64rem up.
@xl:ai:feFrom 80rem up.
@xxl:ai:feFrom 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:ai:feContainer from 32rem up.
@c:sm:ai:feContainer from 40rem up.
@c:md:ai:feContainer from 48rem up.
@c:lg:ai:feContainer from 64rem up.
@c:xl:ai:feContainer from 80rem up.
@c:xxl:ai:feContainer 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:ai:feOn a touch screen.
@prm:ai:feWith reduced motion on.
@st:ai:feOn the first frame.

States

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

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

Pseudo Elements

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

a::ai:feOn ::after.
b::ai:feOn ::before.
p::ai:feOn ::placeholder.
s::ai:feOn ::selection.