Skip to main content

Align Self

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

View as Markdown
baselinewidely
ClassCSS
as:autoalign-self: auto;
as:balign-self: baseline;
as:calign-self: center;
as:fealign-self: flex-end;
as:fsalign-self: flex-start;
as:salign-self: stretch;

Variants

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

Breakpoints

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

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

States

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

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

Pseudo Elements

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

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