TypographyVertical Align

Vertical Align

Controls the vertical alignment of an inline or table-cell box.

Widely available

This feature is well established and works across many devices and browser versions.

Chrome
Edge
Firefox
Safari
ClassStyle
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;

Baseline

Aligns the baseline of the element with the baseline of its parent.

BaselineText
<div class="fs-md c-slate">
<span class="va-ba bw-1 bc-silver-4 p-1">Baseline</span>
<span class="fs-xl">Text</span>
</div>

Middle

Aligns the middle of the element with the baseline plus half the x-height of the parent.

MiddleText
<div class="fs-md c-slate">
<span class="va-m bw-1 bc-silver-4 p-1">Middle</span>
<span class="fs-xl">Text</span>
</div>

Top

Aligns the top of the element with the top of the tallest element on the line.

TopText
<div class="fs-md c-slate">
<span class="va-t bw-1 bc-silver-4 p-1">Top</span>
<span class="fs-xl">Text</span>
</div>

Bottom

Aligns the bottom of the element with the lowest element on the line.

BottomText
<div class="fs-md c-slate">
<span class="va-b bw-1 bc-silver-4 p-1">Bottom</span>
<span class="fs-xl">Text</span>
</div>

Sub

Aligns the baseline of the element with the subscript-baseline of its parent.

SubText
<div class="fs-md c-slate">
<span class="va-s bw-1 bc-silver-4 p-1">Sub</span>
<span class="fs-xl">Text</span>
</div>

Super

Aligns the baseline of the element with the superscript-baseline of its parent.

SuperText
<div class="fs-md c-slate">
<span class="va-su bw-1 bc-silver-4 p-1">Super</span>
<span class="fs-xl">Text</span>
</div>

Using utility variants

Learn how to override existing utilities based on the user's screen size or other factors, such as hover states.

Targeting different viewports

You can combine responsive breakpoints like sm:va-*, md:va-*, lg:va-*, and xxl:va-* to allow targeting specific utilities in different viewports.

Targeting hover states

Alternatively, you can apply :hover by using h:va-* utility to override elements and change their values when hovering over them.