Skip to main content

Vertical Align

Set the vertical alignment of an inline or table-cell element.

View as Markdown
baselinewidely
ClassCSS
va:bvertical-align: bottom;
va:bavertical-align: baseline;
va:mvertical-align: middle;
va:svertical-align: sub;
va:suvertical-align: super;
va:tvertical-align: top;
va:tbvertical-align: text-bottom;
va:ttvertical-align: text-top;

Variants

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

Breakpoints

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

@xs:va:suFrom 32rem up.
@sm:va:suFrom 40rem up.
@md:va:suFrom 48rem up.
@lg:va:suFrom 64rem up.
@xl:va:suFrom 80rem up.
@xxl:va:suFrom 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:va:suContainer from 32rem up.
@c:sm:va:suContainer from 40rem up.
@c:md:va:suContainer from 48rem up.
@c:lg:va:suContainer from 64rem up.
@c:xl:va:suContainer from 80rem up.
@c:xxl:va:suContainer 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:va:suOn a touch screen.
@prm:va:suWith reduced motion on.
@st:va:suOn the first frame.

States

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

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

Pseudo Elements

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

a::va:suOn ::after.
b::va:suOn ::before.
p::va:suOn ::placeholder.
s::va:suOn ::selection.