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.
| Class | Style |
|---|---|
va-b | vertical-align: bottom; |
va-ba | vertical-align: baseline; |
va-m | vertical-align: middle; |
va-s | vertical-align: sub; |
va-su | vertical-align: super; |
va-t | vertical-align: top; |
va-tb | vertical-align: text-bottom; |
va-tt | vertical-align: text-top; |
Baseline
Aligns the baseline of the element with the baseline of its parent.
<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.
<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.
<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.
<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.
<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.
<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.