Vertical-align

Use to change the vertical alignment of inline, inline-block, inline-table, and table cell elements.

Notation #

Vertical-align classes can be defined using the format -vertical-align[-{breakpoint}]--{value}. Breakpoints supported are sm, md, lg, and xl.

Target all breakpoints #

Vertical-align utility classes with no breakpoint defined apply to all screen sizes.

ClassValue
-vertical-align--baselinevertical-align: baseline
-vertical-align--topvertical-align: top
-vertical-align--middlevertical-align: middle
-vertical-align--bottomvertical-align: bottom
-vertical-align--text-topvertical-align: text-top
-vertical-align--text-bottomvertical-align: text-bottom

Target specific breakpoints #

To target a specific breakpoint, add the breakpoint abbreviation to the class. As Chi is a mobile first library, the value will apply to that specific breakpoint and up.

ClassValue
-vertical-align-sm--middle
Vertical middle aligned on sm and up.
-vertical-align-md--middle
Vertical middle aligned on md and up.
-vertical-align-lg--middle
Vertical middle aligned on lg and up.
-vertical-align-xl--middle
Vertical middle aligned on xl and up.

Examples #

Vertical-align is only compatible with inline, inline-block, inline-table, and table cell elements. It cannot be used to vertically align block-level elements.

Baseline #

Use -vertical-align--baseline to align the baseline of an element with the baseline of its parent.

baseline

Top #

Use -vertical-align--top to align the top of the element and its descendants with the top of the entire line.

top

Middle #

Use -vertical-align--middle to align the middle of an element with the baseline plus half the x-height of the parent.

middle

Bottom #

Use -vertical-align--bottom to align the bottom of an element and its descendants with the bottom of the entire line.

bottom

Text top #

Use -vertical-align--text-top to align the top of an element with the top of the parent element's font.

text-top

Text bottom #

Use -vertical-align--text-bottom to align the bottom of an element with the bottom of the parent element's font.

text-bottom

Table cell elements #

Use the vertical-align utility to change the vertical alignment of table cell elements.

ColumnColumnColumnColumnColumn
baselinetopmiddlebottomLorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus vitae faucibus est. Vestibulum lacinia diam ut dignissim fermentum. Phasellus mollis ut lacus vitae molestie. Nam id libero tristique, porta leo non, ultrices neque.